├── LICENSE
├── README.md
├── create-action
├── README.md
└── cURL
│ ├── README.md
│ └── action.xml
├── create-analysis
├── README.md
└── cURL
│ ├── README.md
│ ├── analysis.xml
│ ├── create-analysis-from-menu.png
│ └── create-analysis-from-panel.png
├── create-dashboardvariable
├── README.md
└── cURL
│ ├── README.md
│ └── dashboardvariables.xml
├── create-fixlet
├── README.md
└── cURL
│ ├── Create_new_fixlet.png
│ ├── README.md
│ └── fixlet.xml
├── create-operator
├── README.md
└── cURL
│ ├── ChooseOperators.png
│ ├── CreateLocalOperator.png
│ ├── FillData.png
│ ├── README.md
│ ├── RightClick.png
│ ├── SelectPermissions.png
│ └── operator.xml
├── create-role
├── README.md
└── cURL
│ ├── README.md
│ └── role.xml
├── create-site
├── README.md
└── cURL
│ ├── README.md
│ ├── create_site_dialog.png
│ ├── create_site_menu.png
│ └── site.xml
├── delete-computer
└── cURL
│ └── README.md
├── evaluate-relevance
├── README.md
└── cURL
│ └── README.md
├── fetch-computers
├── README.md
└── cURL
│ └── README.md
├── import-xml
├── README.md
└── cURL
│ ├── README.md
│ └── objects.xml
├── powershell-windows-authentication
├── BESWindowsAuthenticationLogin.ps1
└── README.md
├── update-action
├── README.md
└── cURL
│ ├── README.md
│ └── action.xml
├── update-analysis
├── README.md
└── cURL
│ ├── README.md
│ └── analysis.xml
├── update-fixlet
├── README.md
├── cURL
│ ├── README.md
│ └── fixlet.xml
└── img
│ ├── edit-fixlet.png
│ ├── update-fixlet-actions.png
│ ├── update-fixlet-description.png
│ ├── update-fixlet-properties.png
│ └── update-fixlet-relevance.png
├── update-operator
├── README.md
└── cURL
│ ├── README.md
│ └── operator.xml
├── update-role
├── README.md
└── cURL
│ ├── README.md
│ └── role.xml
├── update-site
├── README.md
└── cURL
│ ├── README.md
│ └── site.xml
└── upload-file
├── README.md
└── cURL
├── README.md
├── stuff.txt
├── stuff2.txt
├── stuff3.txt
└── stuff4.txt
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright 2014 International Business Machines, Inc.
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | A collection of examples to demonstrate the usage of the IBM Endpoint Manager
2 | RESTAPI.
3 |
4 | cURL
5 | ===
6 |
7 | Download
8 | ---
9 | Get cURL here: http://curl.haxx.se
10 |
11 | Options
12 | ---
13 |
14 | For the `curl` commands to work successfully:
15 |
16 | * `username` must be your username.
17 | * `password` must be your password.
18 | * `server` must be the hostname of your root server.
19 | * `port` must be the port of your root server. By default, this is 52311.
20 |
21 | Security
22 | ---
23 |
24 | In order for curl to secure the connection to the server, you must install a
25 | [custom HTTPS certificate](http://www-01.ibm.com/support/docview.wss?uid=swg21505848)
26 | and use the `--cacert` option.
27 |
28 | Alternatively, you can use the `--insecure` option to disable HTTPS
29 | certificate verification. This is not recommended.
30 |
31 | Support
32 | ===
33 | Any issues or questions regarding this software should be filed via [GitHub issues](https://github.com/bigfix/restapi-examples/issues).
34 |
--------------------------------------------------------------------------------
/create-action/README.md:
--------------------------------------------------------------------------------
1 | https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Action
2 |
--------------------------------------------------------------------------------
/create-action/cURL/README.md:
--------------------------------------------------------------------------------
1 | Usage
2 | ---
3 |
4 | This command will POST the file `action.xml` to the server to create and execute the new action contained in `action.xml`.
5 |
6 | curl -X POST --data-binary @action.xml --user username:password https://server:port/api/actions
7 |
8 | See [cURL overview](../../README.md#cURL) for more information on using [cURL](http://curl.haxx.se/).
9 |
--------------------------------------------------------------------------------
/create-action/cURL/action.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Test Action for curl readme
5 |
6 | // Enter your action script here
7 | //
8 | // example xml action file for documentation on creating actions with POST
9 |
10 |
11 | false
12 | false
13 | false
14 | false
15 | true
16 | P2D
17 | false
18 | false
19 | NoRequirement
20 | AllUsers
21 | false
22 | false
23 | false
24 | true
25 | 3
26 | false
27 | false
28 | false
29 | true
30 |
31 | false
32 |
33 |
34 | false
35 | false
36 |
37 | false
38 | false
39 | false
40 | false
41 | false
42 | false
43 |
44 | false
45 |
46 | false
47 |
48 | false
49 | false
50 | false
51 | false
52 | false
53 | false
54 | false
55 | false
56 | false
57 | false
58 | false
59 | false
60 | false
61 | false
62 |
63 | false
64 | false
65 | false
66 | false
67 | false
68 |
69 | false
70 | false
71 | false
72 | false
73 |
74 | false
75 |
76 | 13461357
77 |
78 |
79 |
--------------------------------------------------------------------------------
/create-analysis/README.md:
--------------------------------------------------------------------------------
1 | https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Analysis
2 |
--------------------------------------------------------------------------------
/create-analysis/cURL/README.md:
--------------------------------------------------------------------------------
1 | Equivalent Action in Console
2 | ---
3 | * Right-click an Analysis and select "Create New Analysis.."
4 |
5 | 
6 |
7 | * Or, from Menu bar, select "Tool", then choose "Create New Analysis..."
8 |
9 | 
10 |
11 | Explanation of [`analysis.xml`](./analysis.xml)
12 | ---
13 | * Title - (Permissible Values: any string) The title of your custom analysis
14 | * Description - (Permissible Values: any string)The updated description of your custom analysis
15 | * Relevance - (Permissible Values: any relevance expression that evaluates to true or false) A relevance statement that evaluates to true for computers that this Fixlet should run on. All Relevance tags must evaluate to `true` in order for the Fixlet to run.
16 | * Source - (Optional, default to `""`) (Permissible Values: any string)
17 | * SourceReleaseDate - (Optional, default to the date of sourse release) (Permissible Values: a date in `yyyy-mm-dd` format)
18 | * MIMEField - (Optional, default to
19 | ```
20 |
21 | x-fixlet-modification-time
22 | TIME WHEN CREATED
23 |
24 | ```
25 | * Domain - (Optional)
26 | * Proprety - (Optional) (Permissible Values: an existed property name) Name of the property that is analyzed. (When adding a new property, increase its ID in the new tag, eg.`local time zone`)
27 |
28 | Usage
29 | ---
30 |
31 | This command will POST the file [`analysis.xml`](./analysis.xml) to the server to create a new analysis called `My Custom Analysis` for a custom site named `Test-Site`.
32 |
33 | curl -X POST --data-binary @analysis.xml --user username:password https://server:port/api/analyses/custom/Test-Site
34 |
35 | See [cURL overview](../../README.md#cURL) for more information on using [cURL](http://curl.haxx.se/).
36 |
--------------------------------------------------------------------------------
/create-analysis/cURL/analysis.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | My Custom Analysis
5 | A sample analysis
6 | true
7 | Internal
8 | 2014-05-29
9 |
10 | x-fixlet-modification-time
11 | Thu, 29 May 2014 22:35:16 +0000
12 |
13 | BESC
14 | exists BES computer
15 |
16 |
--------------------------------------------------------------------------------
/create-analysis/cURL/create-analysis-from-menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigfix/restapi-examples/a3b4c1118bb1415200031f3ec8f30015c11eaffe/create-analysis/cURL/create-analysis-from-menu.png
--------------------------------------------------------------------------------
/create-analysis/cURL/create-analysis-from-panel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigfix/restapi-examples/a3b4c1118bb1415200031f3ec8f30015c11eaffe/create-analysis/cURL/create-analysis-from-panel.png
--------------------------------------------------------------------------------
/create-dashboardvariable/README.md:
--------------------------------------------------------------------------------
1 | https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Dashboard%20Variables
2 |
--------------------------------------------------------------------------------
/create-dashboardvariable/cURL/README.md:
--------------------------------------------------------------------------------
1 | Usage
2 | ---
3 |
4 | This command will POST the file `dashboardvariables.xml` to the server to create the new DashboardVariables contained in `dashboardvariables.xml`.
5 |
6 | curl -X POST --data-binary @dashboardvariables.xml --user username:password https://server:port/api/dashboardvariables/Odometer.ojo
7 |
8 | See [cURL overview](../../README.md#cURL) for more information on using [cURL](http://curl.haxx.se/).
9 |
--------------------------------------------------------------------------------
/create-dashboardvariable/cURL/dashboardvariables.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Odometer.ojo
5 | distance
6 | true
7 | {"miles":"500","kilometers":"800"}
8 |
9 |
10 | Odometer.ojo
11 | trip
12 | false
13 | {"miles":"50","kilometers":"80"}
14 |
15 |
16 |
--------------------------------------------------------------------------------
/create-fixlet/README.md:
--------------------------------------------------------------------------------
1 | https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Fixlet
2 |
--------------------------------------------------------------------------------
/create-fixlet/cURL/Create_new_fixlet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigfix/restapi-examples/a3b4c1118bb1415200031f3ec8f30015c11eaffe/create-fixlet/cURL/Create_new_fixlet.png
--------------------------------------------------------------------------------
/create-fixlet/cURL/README.md:
--------------------------------------------------------------------------------
1 | Equivalent Action in Console
2 | ---
3 | Select a Site to add the fixlet to -> click "Fixlets and Tasks" -> Right-click any fixlet and select "Create New Fixlet..."
4 | 
5 |
6 | Explanation of [`fixlet.xml`](https://github.com/bigfix/restapi-examples/blob/master/create-fixlet/cURL/fixlet.xml)
7 | ---
8 | * Title - (Permissible Values: any string) The name of the Fixlet
9 | * Description - (Permissible Values: any string) A user-defined description of what the Fixlet does; can contain HTML content
10 | * Relevance - One or more *Relevance* tags, or a single *GroupRelevance* tag
11 | * Relevance - (Permissible Values: any relevance expression that evaluates to true or false) A relevance statement that evaluates to true for computers that this Fixlet should run on. All Relevance tags must evaluate to `true` in order for the Fixlet to run.
12 | * GroupRelevance - Same as relevance but for Computer Groups that this Fixlet should run on.
13 | * Category - (Optional, defaults to `""`) (Permissible Values: any string) User-defined groupings (for example, "Licensing", "Update", "Support")
14 | * DownloadSize - (Optional, defaults to `0`) (Permissible Values: any non-negative integer) The size of the download that this Fixlet will run.
15 | * Source - (Optional, defaults to `""`) (Permissible Values: any string) The organization or company that produced this Fixlet
16 | * SourceID - (Optional, defaults to `""`) (Permissible Values: any string) The ID of that organization or company
17 | * SourceReleaseDate - (Optional, defaults to `""`) (Permissible Values: any valid date in the format `yyyy-mm-dd`) The date this Fixlet was released
18 | * SourceSeverity - (Optional, defaults to `""`) (Permissible Values: any string) How important this Fixlet is (Critical, Moderate, etc.)
19 | * DefaultAction - (Optional; if omitted then no default action set) The Action to take by default (bolded in the "Take Action" menu)
20 | * _Attribute "ID"_ - (Permissible Values: any string) The name of this action. In the console, this is automatically be set to something like `Action1`.
21 | * Description - (Optional, defaults to `""`) The text that appears in the Actions box of the Description tab of a Fixlet. Clicking on the link will initiate the "Take Action" dialog box
22 | * PreLink - (Permissible Values: any string) The text that comes before the link
23 | * Link - (Permissible Values: any string) The text that will be a link
24 | * PostLink - (Permissible Values: any string) The text after the link
25 | * ActionScript - (Permissible Values: any ActionScript)
26 | * _Attribute "MIMEType"_ - (Optional, defaults to BigFix ActionScript)
27 | * Action - (Optional, Repeatable; if omitted then no default action set) An Action that this Fixlet can take. Any number of these tags can appear; each will create a separate Action.
28 | * _Attribute "ID"_ - (Permissible Values: any string) The name of this action. In the console, this is automatically be set to something like `Action1`.
29 | * Description - (Optional, defaults to `""`) The text that appears in the Actions box of the Description tab of a Fixlet. Clicking on the link will initiate the "Take Action" dialog box
30 | * PreLink - (Permissible Values: any string) The text that comes before the link
31 | * Link - (Permissible Values: any string) The text that will be a link
32 | * PostLink - (Permissible Values: any string) The text after the link
33 | * ActionScript - (Permissible Values: any ActionScript)
34 | * _Attribute "MIMEType"_ - (Optional, defaults to BigFix ActionScript)
35 |
36 | Usage
37 | ---
38 | This command will POST the [`fixlet.xml`](https://github.com/bigfix/restapi-examples/blob/master/create-fixlet/cURL/fixlet.xml) file to the server, creating a fixlet
39 | from the operator source `bigfix` with severity `critical` to shut down all
40 | clients with an outdated version.
41 |
42 | curl -X POST --data-binary @fixlet.xml --user username:password https://server:port/api/fixlets/operator/bigfix
43 |
44 | See [cURL overview](../../README.md#cURL) for more information on using cURL.
--------------------------------------------------------------------------------
/create-fixlet/cURL/fixlet.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Shutdown Clients with Outdated Versions
5 |
Shutdown all clients with a version older than 9.1.1065.
7 | ]]>
8 | exists relay service OR exists main gather service
9 |
10 | Support
11 | 0
12 | BigFix
13 | ]]>
14 | 2004-10-06
15 | Critical
16 |
17 |
18 | Click
19 | here
20 | to shutdown outdated clients.
21 |
22 | shutdown
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/create-operator/README.md:
--------------------------------------------------------------------------------
1 | https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Operator
2 |
--------------------------------------------------------------------------------
/create-operator/cURL/ChooseOperators.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigfix/restapi-examples/a3b4c1118bb1415200031f3ec8f30015c11eaffe/create-operator/cURL/ChooseOperators.png
--------------------------------------------------------------------------------
/create-operator/cURL/CreateLocalOperator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigfix/restapi-examples/a3b4c1118bb1415200031f3ec8f30015c11eaffe/create-operator/cURL/CreateLocalOperator.png
--------------------------------------------------------------------------------
/create-operator/cURL/FillData.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigfix/restapi-examples/a3b4c1118bb1415200031f3ec8f30015c11eaffe/create-operator/cURL/FillData.png
--------------------------------------------------------------------------------
/create-operator/cURL/README.md:
--------------------------------------------------------------------------------
1 | Equivalent Action in Console
2 | ===
3 | 
4 |
5 | Open the operators tab.
6 |
7 | 
8 |
9 | Right-click the field containing existing operators.
10 |
11 | 
12 |
13 | Select "Create local operator".
14 |
15 | 
16 |
17 | Add username and password.
18 |
19 | 
20 |
21 | Select the permissions, explained below.
22 |
23 | Explanation of [operator.xml](operator.xml)
24 | ===
25 | All of these tags go under the "Operator" tag in the [operator.xml](operator.xml) file provided, in the order displayed here. Some tags were not included in operator.xml, but can be written in. Alternatively, run the following curl command:
26 |
27 | curl -X GET --user username:password https://server:port/api/operators
28 |
29 | and fill in the XML file returned with the data of the operator you wish to create. If multiple operators are returned, remove all operator tags but one. You will have to add the "Password" tag immediately below the "Name" tag.
30 |
31 |
32 |
33 | * Name - (Permissible Values: any string) Name of the operator
34 | * Password - (Permissible Values: any string) Operator password
35 | * MasterOperator - (Optional, defaults to false) (Permissible Values: true, false) Is the operator created a master operator? Note: If MasterOperator is set to true, the remaining tags are unneccessary to include in the xml file and will be set to their default values. Any attempt to change any of the remaining tags to non-default values will be overriden back to their default values.
36 | * CustomContent - (Optional, defaults to true) (Permissible Values: true, false) Can this operator create custom content?
37 | * ShowOtherActions - (Optional, defaults to true) (Permissible Values: true, false) Can this operator see actions submitted by other operators?
38 | * CanCreateActions - (Optional, defaults to true) (Permissible Values: true, false) Can this operator create actions?
39 | * PostActionBehaviorPrivelege - (Optional, defaults to AllowRestartAndShutdown) (Permissible Values: AllowRestartAndShutdown, AllowRestartOnly, None) What can this operator force a computer to do after an action?
40 | * ActionScriptCommandsPrivelege - (Optional, defaults to AllowRestartAndShutdown) (Permissible Values: AllowRestartAndShutdown, AllowRestartOnly, None) What can this operator force a computer to do at any time?
41 | * CanLock - (Optional, defaults to true) (Permissible Values: true, false) Can the operator lock targets (prevent other operators from running activities on these targets)?
42 | * CanSendMultipleRefresh - (Optional, defaults to true) (Permissible Values: true, false) Can this operator run a refresh on more than one target?
43 | * LoginPermission - (Optional, defaults to Unrestricted) (Permissible Values: Unrestricted, RoleRestricted, Disabled) When can this operator log in?
44 | * Unrestricted: always
45 | * RoleRestricted: only when they are a member of at least one role
46 | * Disabled: never
47 | * UnmanagedAssetPrivelege - (Optional, defaults to ShowAll) (Permissible Values: ShowAll, ScanPoint, ShowNone) Specifies if the operator can manage assets on which no IBM Endpoint Manager component is installed
48 |
49 |
50 | Usage
51 | ===
52 | This command will POST the file [operator.xml](operator.xml) to the server to create a
53 | non-master-operator `eddard` with password `winterfell`:
54 |
55 | curl -X POST --data-binary @operator.xml --user username:password https://server:port/api/operators
56 |
57 | See [cURL overview](../../README.md#cURL) for more information on using [cURL](http://curl.haxx.se/).
58 |
--------------------------------------------------------------------------------
/create-operator/cURL/RightClick.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigfix/restapi-examples/a3b4c1118bb1415200031f3ec8f30015c11eaffe/create-operator/cURL/RightClick.png
--------------------------------------------------------------------------------
/create-operator/cURL/SelectPermissions.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigfix/restapi-examples/a3b4c1118bb1415200031f3ec8f30015c11eaffe/create-operator/cURL/SelectPermissions.png
--------------------------------------------------------------------------------
/create-operator/cURL/operator.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | eddard
5 | winterfell
6 | false
7 | false
8 | Unrestricted
9 | ShowAll
10 |
11 |
12 |
--------------------------------------------------------------------------------
/create-role/README.md:
--------------------------------------------------------------------------------
1 | https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Role
2 |
--------------------------------------------------------------------------------
/create-role/cURL/README.md:
--------------------------------------------------------------------------------
1 | Usage
2 | ---
3 |
4 | This command will POST the file `role.xml` to the server to create the new role contained in `role.xml`.
5 |
6 | curl -X POST --data-binary @role.xml --user username:password https://server:port/api/roles
7 |
8 | See [cURL overview](../../README.md#cURL) for more information on using [cURL](http://curl.haxx.se/).
9 |
--------------------------------------------------------------------------------
/create-role/cURL/role.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | New Role
4 | This is a test role
5 | 1
6 | 1
7 | 1
8 | ShowAll
9 |
10 |
--------------------------------------------------------------------------------
/create-site/README.md:
--------------------------------------------------------------------------------
1 | https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Site
2 |
--------------------------------------------------------------------------------
/create-site/cURL/README.md:
--------------------------------------------------------------------------------
1 | Equivalent Action in Console
2 | ===
3 |
4 | Click on the Main Menu -> Tools -> Create Custom Site.
5 |
6 | 
7 |
8 | 
9 |
10 | Explanation of [`site.xml`](site.xml)
11 | ====
12 |
13 | Starts with the `CustomSite` tag.
14 |
15 | * Name - (Permissible Values: any string) Name of new Site
16 | * Description - (Optional, defaults to empty string) (Permissible Values: any string) Description about new Site
17 | * Domain - (Optional) (Permissible Values: any 4 alphanumeric characters)
18 | * GlobalReadPermission - (Optional) (Permissible Values: true, false)
19 | * Subscriptions - (Optional)
20 | * Mode - (Permissible Values: All, None, AdHoc, Custom)
21 | * CustomGroup - (Optional)
22 | * Attribute JoinByIntersection - (Permissible Values: true, false)
23 | * SearchComponentRelevance
24 | * Attribute Comparison - (Permissible Values: IsTrue, IsFalse)
25 | * Relevance - (Permissible Values: any relevance expression)
26 | * SiteRelevance - (Optional) (Permissible Values: any string)
27 |
28 | Usage
29 | ---
30 |
31 | This command will POST the file [`site.xml`](site.xml) to the server to create the new CustomSite contained in `site.xml`.
32 |
33 | curl -X POST --data-binary @site.xml --user username:password https://server:port/api/sites
34 |
35 | See [cURL overview](../../README.md#cURL) for more information on using [cURL](http://curl.haxx.se/).
36 |
--------------------------------------------------------------------------------
/create-site/cURL/create_site_dialog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigfix/restapi-examples/a3b4c1118bb1415200031f3ec8f30015c11eaffe/create-site/cURL/create_site_dialog.png
--------------------------------------------------------------------------------
/create-site/cURL/create_site_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigfix/restapi-examples/a3b4c1118bb1415200031f3ec8f30015c11eaffe/create-site/cURL/create_site_menu.png
--------------------------------------------------------------------------------
/create-site/cURL/site.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | New Custom Site Name
5 | Description about this Site.
6 | BESC
7 | false
8 |
9 | Custom
10 |
11 |
12 | true
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/delete-computer/cURL/README.md:
--------------------------------------------------------------------------------
1 | This example will delete a computer:
2 |
3 | curl -k -X "DELETE" --user bigfix:bigfix https://server:port/api/computer/__COMPUTER_ID__
4 |
--------------------------------------------------------------------------------
/evaluate-relevance/README.md:
--------------------------------------------------------------------------------
1 | https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Relevance
2 |
--------------------------------------------------------------------------------
/evaluate-relevance/cURL/README.md:
--------------------------------------------------------------------------------
1 | Usage
2 | ---
3 |
4 | This command will return the result of evaluating the `RELEVANCE` expression passed to the server.
5 |
6 | curl --data-urlencode "relevance=RELEVANCE" --user username:password https://server:port/api/query
7 |
8 | This example will return the name & id of all computers:
9 |
10 | curl -k --data-urlencode relevance="(name of it, id of it) of bes computers" --user bigfix:bigfix https://server:port/api/query
11 |
12 | [This example](http://bigfix.me/fixlet/details/6116) will create [BaselineComponent](https://forum.bigfix.com/t/sqlite-inspector-read-only-databases/13606/19)s XML from fixlet objects.
13 |
14 | curl --data-urlencode relevance="concatenations %22%22 of (%22%22 & item 6 of it & %22%22 & item 8 of it & %22%22 & item 9 of it & %22%22) of (name of it, (it as string as lowercase) of (not success on run to completion of default action of it), url of site of it, (it as string) of id of it, content id of default action of it, script type of default action of it, (%22%22) of script of default action of it, (if (success on custom relevance of it) then %22CustomRelevance%22 else if (success on original relevance of it) then %22OriginalRelevance%22 else if (success on run to completion of it) then %22RunToCompletion%22 else %22%22) of default action of it, (if (not success on custom relevance of it) then %22%22 else (%22%22) of (custom success relevance of it)) of default action of it, (%22%22) of relevance of it) of fixlets whose(name of it does not contain %22(Superseded)%22 AND name of it as lowercase contains %22endpoint manager%22 AND name of it as lowercase contains %22client%22 AND globally visible flag of it) of bes sites whose(%22BES Support%22 = name of it)" --user username:password https://server:port/api/query
15 |
16 | See [cURL overview](../../README.md#cURL) for more information on using [cURL](http://curl.haxx.se/).
17 |
18 | - http://curl.haxx.se/docs/manpage.html#--data-urlencode
19 |
--------------------------------------------------------------------------------
/fetch-computers/README.md:
--------------------------------------------------------------------------------
1 | https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Computer
2 |
--------------------------------------------------------------------------------
/fetch-computers/cURL/README.md:
--------------------------------------------------------------------------------
1 |
2 | Usage
3 | ---
4 |
5 | This command will GET the XML file that displays a list of all computers.
6 |
7 | curl -X GET --user username:password https://server:port/api/computers
8 |
9 | See [cURL overview](../../README.md#cURL) for more information on using [cURL](http://curl.haxx.se/).
10 |
11 |
--------------------------------------------------------------------------------
/import-xml/README.md:
--------------------------------------------------------------------------------
1 | ## Examples:
2 |
3 | - Using [cURL](cURL/)
4 |
5 |
6 | ## Documentation:
7 |
8 | - [BigFix REST API: Import](https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Import) (DevWorks Wiki)
9 |
--------------------------------------------------------------------------------
/import-xml/cURL/README.md:
--------------------------------------------------------------------------------
1 | Usage
2 | ---
3 |
4 | This command will POST `objects.xml` onto the server, importing the provided items in `objects.xml` (`Imported Analysis`, `Imported Fixlet 1` and `Imported Fixlet 2`) into the Custom Site `mySite`.
5 |
6 | curl -X POST --data-binary @objects.xml --user username:password https://server:port/api/import/custom/mySite/
7 |
8 | Similar but with more options:
9 |
10 | curl -k -X POST --data-binary @"path with spaces\objects.xml" --header "Content-Type:text/xml" -o "C:\Windows\Temp\RESTAPI_Import.log" --user username:password https://server:port/api/import/custom/mySite/
11 |
12 | Example
13 | ---
14 |
15 | - http://bigfix.me/fixlet/details/6116
16 |
17 | ---
18 |
19 | See [cURL overview](../../README.md#cURL) for more information on using [cURL](http://curl.haxx.se/).
20 |
--------------------------------------------------------------------------------
/import-xml/cURL/objects.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Imported Analysis
5 | A sample analysis
6 | true
7 | Internal
8 | 2014-05-29
9 |
10 | x-fixlet-modification-time
11 | Thu, 29 May 2014 22:35:16 +0000
12 |
13 | BESC
14 | exists BES computer
15 |
16 |
17 | Imported Fixlet 1
18 |
Shutdown all clients with a version older than 9.1.1065.
20 | ]]>
21 | exists relay service OR exists main gather service
22 |
23 | Support
24 | 0
25 | BigFix
26 | ]]>
27 | 2004-10-06
28 | Critical
29 |
30 |
31 | Click
32 | here
33 | to shutdown outdated clients.
34 |
35 | shutdown
36 |
37 |
38 |
39 | Imported Fixlet 2
40 |
Shutdown all clients with a version older than 9.1.1065.
42 | ]]>
43 | exists relay service OR exists main gather service
44 |
45 | Support
46 | 0
47 | BigFix
48 | ]]>
49 | 2004-10-06
50 | Critical
51 |
52 |
53 | Click
54 | here
55 | to shutdown outdated clients.
56 |
57 | shutdown
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/powershell-windows-authentication/BESWindowsAuthenticationLogin.ps1:
--------------------------------------------------------------------------------
1 | Param([parameter(Mandatory=$true,
2 | HelpMessage="Enter server url [ -server ]")]
3 | $serverUrl
4 | )
5 | if(!$serverUrl){
6 | return "Enter server url [ -server ]"
7 | }
8 | function GetBigFixToken {
9 | [CmdletBinding()]
10 | param($PN)
11 | $Signature = @"
12 |
13 | public enum SecBufferType
14 | {
15 | SECBUFFER_VERSION = 0,
16 | SECBUFFER_EMPTY = 0,
17 | SECBUFFER_DATA = 1,
18 | SECBUFFER_TOKEN = 2
19 | }
20 |
21 | [StructLayout(LayoutKind.Sequential)]
22 | public struct SECURITY_INTEGER
23 | {
24 | public uint LowPart;
25 | public int HighPart;
26 | public SECURITY_INTEGER(int dummy)
27 | {
28 | LowPart = 0;
29 | HighPart = 0;
30 | }
31 | };
32 |
33 | [StructLayout(LayoutKind.Sequential)]
34 | public struct SecBuffer : IDisposable
35 | {
36 | public int cbBuffer;
37 | public int BufferType;
38 | public IntPtr pvBuffer;
39 |
40 |
41 | public SecBuffer(int bufferSize)
42 | {
43 | cbBuffer = bufferSize;
44 | BufferType = (int)SecBufferType.SECBUFFER_TOKEN;
45 | pvBuffer = Marshal.AllocHGlobal(bufferSize);
46 | }
47 |
48 | public SecBuffer(byte[] secBufferBytes)
49 | {
50 | cbBuffer = secBufferBytes.Length;
51 | BufferType = (int)SecBufferType.SECBUFFER_TOKEN;
52 | pvBuffer = Marshal.AllocHGlobal(cbBuffer);
53 | Marshal.Copy(secBufferBytes,0,pvBuffer,cbBuffer);
54 | }
55 |
56 | public SecBuffer(byte[] secBufferBytes,SecBufferType bufferType)
57 | {
58 | cbBuffer = secBufferBytes.Length;
59 | BufferType = (int)bufferType;
60 | pvBuffer = Marshal.AllocHGlobal(cbBuffer);
61 | Marshal.Copy(secBufferBytes,0,pvBuffer,cbBuffer);
62 | }
63 |
64 | public void Dispose()
65 | {
66 | if(pvBuffer != IntPtr.Zero)
67 | {
68 | Marshal.FreeHGlobal(pvBuffer);
69 | pvBuffer = IntPtr.Zero;
70 | }
71 | }
72 | }
73 |
74 | public struct MultipleSecBufferHelper
75 | {
76 | public byte[] Buffer;
77 | public SecBufferType BufferType;
78 |
79 | public MultipleSecBufferHelper(byte[] buffer,SecBufferType bufferType)
80 | {
81 | if(buffer == null || buffer.Length == 0)
82 | {
83 | throw new ArgumentException("buffer cannot be null or 0 length");
84 | }
85 |
86 | Buffer = buffer;
87 | BufferType = bufferType;
88 | }
89 | };
90 |
91 | [StructLayout(LayoutKind.Sequential)]
92 | public struct SecBufferDesc : IDisposable
93 | {
94 |
95 | public int ulVersion;
96 | public int cBuffers;
97 | public IntPtr pBuffers; //Point to SecBuffer
98 |
99 | public SecBufferDesc(int bufferSize)
100 | {
101 | ulVersion = (int)SecBufferType.SECBUFFER_VERSION;
102 | cBuffers = 1;
103 | SecBuffer ThisSecBuffer = new SecBuffer(bufferSize);
104 | pBuffers = Marshal.AllocHGlobal(Marshal.SizeOf(ThisSecBuffer));
105 | Marshal.StructureToPtr(ThisSecBuffer,pBuffers,false);
106 | }
107 |
108 | public SecBufferDesc(byte[] secBufferBytes)
109 | {
110 | ulVersion = (int)SecBufferType.SECBUFFER_VERSION;
111 | cBuffers = 1;
112 | SecBuffer ThisSecBuffer = new SecBuffer(secBufferBytes);
113 | pBuffers = Marshal.AllocHGlobal(Marshal.SizeOf(ThisSecBuffer));
114 | Marshal.StructureToPtr(ThisSecBuffer,pBuffers,false);
115 | }
116 |
117 | public SecBufferDesc(MultipleSecBufferHelper[] secBufferBytesArray)
118 | {
119 | if(secBufferBytesArray == null || secBufferBytesArray.Length == 0)
120 | {
121 | throw new ArgumentException("secBufferBytesArray cannot be null or 0 length");
122 | }
123 |
124 | ulVersion = (int)SecBufferType.SECBUFFER_VERSION;
125 | cBuffers = secBufferBytesArray.Length;
126 |
127 | pBuffers = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SecBuffer)) * cBuffers);
128 |
129 | for(int Index = 0;Index < secBufferBytesArray.Length;Index++)
130 | {
131 | SecBuffer ThisSecBuffer = new SecBuffer(secBufferBytesArray[Index].Buffer,secBufferBytesArray[Index].BufferType);
132 |
133 | int CurrentOffset = Index*Marshal.SizeOf(typeof(SecBuffer));
134 | Marshal.WriteInt32(pBuffers,CurrentOffset,ThisSecBuffer.cbBuffer);
135 | Marshal.WriteInt32(pBuffers,CurrentOffset + Marshal.SizeOf(ThisSecBuffer.cbBuffer),ThisSecBuffer.BufferType);
136 | Marshal.WriteIntPtr(pBuffers,CurrentOffset + Marshal.SizeOf(ThisSecBuffer.cbBuffer)+Marshal.SizeOf(ThisSecBuffer.BufferType),ThisSecBuffer.pvBuffer);
137 | }
138 | }
139 |
140 | public void Dispose()
141 | {
142 | if(pBuffers != IntPtr.Zero)
143 | {
144 | if(cBuffers == 1)
145 | {
146 | SecBuffer ThisSecBuffer = (SecBuffer)Marshal.PtrToStructure(pBuffers,typeof(SecBuffer));
147 | ThisSecBuffer.Dispose();
148 | }
149 | else
150 | {
151 | for(int Index = 0;Index < cBuffers;Index++)
152 | {
153 | int CurrentOffset = Index*Marshal.SizeOf(typeof(SecBuffer));
154 | IntPtr SecBufferpvBuffer = Marshal.ReadIntPtr(pBuffers,CurrentOffset + Marshal.SizeOf(typeof(int))+Marshal.SizeOf(typeof(int)));
155 | Marshal.FreeHGlobal(SecBufferpvBuffer);
156 | }
157 | }
158 |
159 | Marshal.FreeHGlobal(pBuffers);
160 | pBuffers = IntPtr.Zero;
161 | }
162 | }
163 |
164 | public byte[] GetSecBufferByteArray()
165 | {
166 | byte[] Buffer = null;
167 |
168 | if(pBuffers == IntPtr.Zero)
169 | {
170 | throw new InvalidOperationException("Object has already been disposed!!!");
171 | }
172 |
173 | if(cBuffers == 1)
174 | {
175 | SecBuffer ThisSecBuffer = (SecBuffer)Marshal.PtrToStructure(pBuffers,typeof(SecBuffer));
176 |
177 | if(ThisSecBuffer.cbBuffer > 0)
178 | {
179 | Buffer = new byte[ThisSecBuffer.cbBuffer];
180 | Marshal.Copy(ThisSecBuffer.pvBuffer,Buffer,0,ThisSecBuffer.cbBuffer);
181 | }
182 | }
183 | else
184 | {
185 | int BytesToAllocate = 0;
186 |
187 | for(int Index = 0;Index < cBuffers;Index++)
188 | {
189 | int CurrentOffset = Index*Marshal.SizeOf(typeof(SecBuffer));
190 | BytesToAllocate += Marshal.ReadInt32(pBuffers,CurrentOffset);
191 | }
192 |
193 | Buffer = new byte[BytesToAllocate];
194 |
195 | for(int Index = 0,BufferIndex = 0;Index < cBuffers;Index++)
196 | {
197 | int CurrentOffset = Index*Marshal.SizeOf(typeof(SecBuffer));
198 | int BytesToCopy = Marshal.ReadInt32(pBuffers,CurrentOffset);
199 | IntPtr SecBufferpvBuffer = Marshal.ReadIntPtr(pBuffers,CurrentOffset + Marshal.SizeOf(typeof(int))+Marshal.SizeOf(typeof(int)));
200 | Marshal.Copy(SecBufferpvBuffer,Buffer,BufferIndex,BytesToCopy);
201 | BufferIndex += BytesToCopy;
202 | }
203 | }
204 |
205 | return(Buffer);
206 | }
207 |
208 | public SecBuffer GetSecBuffer()
209 | {
210 | if(pBuffers == IntPtr.Zero)
211 | {
212 | throw new InvalidOperationException("Object has already been disposed!!!");
213 | }
214 |
215 | return((SecBuffer)Marshal.PtrToStructure(pBuffers,typeof(SecBuffer)));
216 | }
217 | }
218 |
219 | [StructLayout(LayoutKind.Sequential)]
220 | public struct SECURITY_HANDLE
221 | {
222 | public uint LowPart;
223 | public uint HighPart;
224 | public SECURITY_HANDLE(int dummy)
225 | {
226 | LowPart = HighPart = 0;
227 | }
228 | };
229 |
230 |
231 | [DllImport("secur32.dll", SetLastError=true)]
232 | static extern int AcquireCredentialsHandle(
233 | string pszPrincipal, //SEC_CHAR*
234 | string pszPackage, //SEC_CHAR* //"Kerberos","NTLM","Negotiative"
235 | int fCredentialUse,
236 | IntPtr PAuthenticationID,//_LUID AuthenticationID,//pvLogonID, //PLUID
237 | IntPtr pAuthData,//PVOID
238 | int pGetKeyFn, //SEC_GET_KEY_FN
239 | IntPtr pvGetKeyArgument, //PVOID
240 | ref SECURITY_HANDLE phCredential, //SecHandle //PCtxtHandle ref
241 | ref SECURITY_INTEGER ptsExpiry //PTimeStamp //TimeStamp ref
242 | );
243 |
244 | [DllImport("secur32.dll", SetLastError=true)]
245 | static extern int InitializeSecurityContext(
246 | ref SECURITY_HANDLE phCredential,//PCredHandle
247 | IntPtr phContext, //PCtxtHandle
248 | string pszTargetName,
249 | int fContextReq,
250 | int Reserved1,
251 | int TargetDataRep,
252 | IntPtr pInput, //PSecBufferDesc SecBufferDesc
253 | int Reserved2,
254 | out SECURITY_HANDLE phNewContext, //PCtxtHandle
255 | out SecBufferDesc pOutput, //PSecBufferDesc SecBufferDesc
256 | out uint pfContextAttr, //managed ulong == 64 bits!!!
257 | out SECURITY_INTEGER ptsExpiry //PTimeStamp
258 | );
259 |
260 | public static SECURITY_HANDLE phCredential;
261 | public static SECURITY_INTEGER ptsExpiry;
262 |
263 | public const int ISC_REQ_DELEGATE = 0x00000001;
264 | public const int ISC_REQ_MUTUAL_AUTH = 0x00000002;
265 | public const int ISC_REQ_CONFIDENTIALITY = 0x00000010;
266 | public const int ISC_REQ_ALLOCATE_MEMORY = 0x00000100;
267 | public const int ISC_REQ_CONNECTION = 0x00000800;
268 | public const int ISC_REQ_INTEGRITY = 0x00010000;
269 |
270 |
271 | public const int STANDARD_CONTEXT_ATTRIBUTES = ISC_REQ_CONNECTION | ISC_REQ_MUTUAL_AUTH | ISC_REQ_DELEGATE | ISC_REQ_CONFIDENTIALITY | ISC_REQ_INTEGRITY | ISC_REQ_ALLOCATE_MEMORY ;
272 | public const int SECURITY_NETWORK_DREP = 0x00000000;
273 |
274 | public const int SEC_E_OK = 0;
275 | public const int SECPKG_CRED_BOTH = 3;
276 |
277 | const int MAX_TOKEN_SIZE = 12288;
278 |
279 | public static SecBufferDesc ClientToken = new SecBufferDesc(MAX_TOKEN_SIZE);
280 | public static uint ContextAttributes = 0;
281 | public static SECURITY_HANDLE _hClientContext = new SECURITY_HANDLE(0);
282 | public static SECURITY_INTEGER ptsexp;
283 |
284 |
285 | public static int GetPrincipalName() {
286 | return AcquireCredentialsHandle(
287 | "",
288 | "Kerberos",
289 | SECPKG_CRED_BOTH,
290 | IntPtr.Zero,
291 | IntPtr.Zero,
292 | 0,
293 | IntPtr.Zero,
294 | ref phCredential,
295 | ref ptsExpiry);
296 | }
297 |
298 | public static string GetToken(string pn) {
299 | if( GetPrincipalName() != SEC_E_OK ) {
300 | throw new Exception("Unable to get PrincipleName");
301 | }
302 |
303 | InitializeSecurityContext(
304 | ref phCredential,
305 | IntPtr.Zero,
306 | pn,
307 | STANDARD_CONTEXT_ATTRIBUTES,
308 | 0,
309 | SECURITY_NETWORK_DREP,
310 | IntPtr.Zero,
311 | 0,
312 | out _hClientContext,
313 | out ClientToken,
314 | out ContextAttributes,
315 | out ptsexp
316 | );
317 |
318 | byte[] token_a = ClientToken.GetSecBufferByteArray();
319 |
320 | return "Kerberos " + Convert.ToBase64String(token_a);
321 | }
322 | "@
323 |
324 | Add-Type -MemberDefinition $Signature -Name WindowsAuthentication -Namespace Secure32
325 | [Secure32.WindowsAuthentication]::GetToken($PN)
326 | }
327 |
328 | #if the server certificate is self signed we need set Powershell to skip SSL certificate checks
329 | add-type @"
330 | using System.Net;
331 | using System.Security.Cryptography.X509Certificates;
332 | public class TrustAllCertsPolicy : ICertificatePolicy {
333 | public bool CheckValidationResult(
334 | ServicePoint srvPoint, X509Certificate certificate,
335 | WebRequest request, int certificateProblem) {
336 | return true;
337 | }
338 | }
339 | "@
340 | [System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
341 |
342 |
343 |
344 |
345 | $PrincipleName = "";
346 |
347 | #The first request is needed to retrieve the principle name. It can be skipped if you already know it.
348 | try
349 | {
350 | Invoke-WebRequest -Uri ('https://'+$serverUrl+':52311/api/login') -Headers @{'PrincipalName' = ''}
351 | }
352 | catch [System.Net.WebException]
353 | {
354 | if($_.Exception.Response.StatusCode.value__ -and $_.Exception.Response.StatusCode.value__ -eq 401){
355 |
356 | $PrincipleName = $_.Exception.Response.Headers['PrincipalName']
357 | #The returned token from GetBigFixToken is already in the requested form "Kerberos "
358 | $token = GetBigFixToken $PrincipleName
359 |
360 | #You can ask for a session token using the login api or you can ask directly other information
361 | # example: Invoke-WebRequest -Uri 'http://localhost:52311/api/sites' -Headers @{'Authorization' = $token}
362 | $response = Invoke-WebRequest -Uri ('https://'+$serverUrl+':52311/api/login') -Headers @{'Authorization' = $token}
363 |
364 | if( $response.StatusCode -eq 200){
365 | Write-Output "Login successful. Session Token received."
366 | #We should now keep the session token returned and use it in the next requests
367 | #Write-Output ("{0} {1}" -f 'SessionToken: ', $response.Headers["SessionToken"])
368 | #Invoke-WebRequest -Uri ('https://'+$serverUrl+':52311/api/sites') -Headers @{'SessionToken' = $response.Headers["SessionToken"]} -OutFile ./result.xml
369 |
370 | }
371 | else {
372 | Write-Output ("Unable to complete login.")
373 | }
374 | }
375 | else{
376 | Write-Output ("Something went wrong contacting the BigFix Server $serverUrl.")
377 | }
378 | }
379 |
380 |
381 |
382 |
--------------------------------------------------------------------------------
/powershell-windows-authentication/README.md:
--------------------------------------------------------------------------------
1 | # Usage
2 |
3 | This script describes the steps to successfully use BigFix REST-API with Powershell with Integrated Windows Authentication that as been already use with the BigFix Console and with the IEM cli. This latter has the "-WindowsAuthentication" parameter to interrogate the BigFix REST-API using the windows credentials of the logged operator.
4 | This script uses the same principle to obtain a session token that can be utilized for next requests.
5 |
6 | By default we set Powershell to skip SSL certificate checks because is not able to verify the chain of the BigFix server certificate.
7 |
8 | The first request aims to retrieve the SPN from the server.
9 | The main function GetBigFixToken return a Kerberos token to authenticate the user and to obtain a session token.
10 | The session token can be now used instead of the Kerberos token in the next requests.
11 |
12 | Note: This is just an example of how the same requests can be done directly in Powershell and not a replacement of the IEM cli tool.
13 |
14 | # Example
15 |
16 | ```posh
17 | BESWindowsAuthenticationLogin.ps1 -server localhost
18 | ```
19 |
--------------------------------------------------------------------------------
/update-action/README.md:
--------------------------------------------------------------------------------
1 | https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Action
2 |
--------------------------------------------------------------------------------
/update-action/cURL/README.md:
--------------------------------------------------------------------------------
1 | Usage
2 | ---
3 |
4 | To update an action, you should first stop the action you want to update:
5 |
6 | curl -X POST --user username:password https://server:port/api/action/ACTIONID/stop
7 |
8 | where `ACTIONID` is the ID of the action to be updated. Then GET that action and store it in `action.xml` for editing:
9 |
10 | curl --user username:password https://server:port/api/action/ACTIONID > action.xml
11 |
12 | After updating `action.xml`, [POST the new action](../../create-action/cURL/README.md). The original action can be optionally deleted.
13 |
14 |
15 | See [cURL overview](../../README.md#cURL) for more information on using cURL.
--------------------------------------------------------------------------------
/update-action/cURL/action.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Test Action for curl readme
5 |
6 | // Enter your action script here
7 | //
8 | // example xml action file for documentation on updating actions with cURL
9 |
10 |
11 | false
12 | false
13 | false
14 | false
15 | true
16 | P2D
17 | false
18 | false
19 | NoRequirement
20 | AllUsers
21 | false
22 | false
23 | false
24 | true
25 | 3
26 | false
27 | false
28 | false
29 | true
30 |
31 | false
32 |
33 |
34 | false
35 | false
36 |
37 | false
38 | false
39 | false
40 | false
41 | false
42 | false
43 |
44 | false
45 |
46 | false
47 |
48 | false
49 | false
50 | false
51 | false
52 | false
53 | false
54 | false
55 | false
56 | false
57 | false
58 | false
59 | false
60 | false
61 | false
62 |
63 | false
64 | false
65 | false
66 | false
67 | false
68 |
69 | false
70 | false
71 | false
72 | false
73 |
74 | false
75 |
76 | 13461357
77 |
78 |
79 |
--------------------------------------------------------------------------------
/update-analysis/README.md:
--------------------------------------------------------------------------------
1 | https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Analysis
2 |
--------------------------------------------------------------------------------
/update-analysis/cURL/README.md:
--------------------------------------------------------------------------------
1 | Usage
2 | ---
3 |
4 | This command will PUT the file `analysis.xml` onto the server to update the analysis with ID `37` for a custom site named `Test-Site`.
5 |
6 | curl -X PUT --data-binary @analysis.xml --user username:password https://server:port/api/analysis/custom/Test-Site/37
7 |
8 | See [cURL overview](../../README.md#cURL) for more information on using [cURL](http://curl.haxx.se/).
9 |
--------------------------------------------------------------------------------
/update-analysis/cURL/analysis.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | My Custom Analysis
5 | My updated description
6 | true
7 | Internal
8 | 2014-05-29
9 |
10 | x-fixlet-modification-time
11 | Thu, 29 May 2014 22:35:16 +0000
12 |
13 | BESC
14 | exists BES computer
15 |
16 |
--------------------------------------------------------------------------------
/update-fixlet/README.md:
--------------------------------------------------------------------------------
1 | https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Fixlet
2 |
--------------------------------------------------------------------------------
/update-fixlet/cURL/README.md:
--------------------------------------------------------------------------------
1 | Equivalent Action in Console
2 | ===
3 | Right-click a Fixlet and select "Edit".
4 | 
5 |
6 | Explanation of [`fixlet.xml`](fixlet.xml)
7 | ===
8 | * Title - (Permissible Values: any string) The name of the Fixlet
9 | * Description - (Permissible Values: any string) A user-defined description of what the Fixlet does; can contain HTML content (if HTML is used, should be contained in a `` block.
10 |
11 | 
12 | This screenshot shows the fixlet's title, description, and lists the descriptions of its actions.
13 |
14 | * One or more *Relevance* tags, or a single *GroupRelevance* tag
15 | * Relevance - (Permissible Values: any relevance expression that evaluates to true or false) A relevance statement that evaluates to true when executed against computers that this Fixlet should run on. All Relevance tags must evaluate to `true` in order for the Fixlet to run.
16 | * GroupRelevance - Same as relevance but for Computer Groups that this Fixlet should run on.
17 |
18 | 
19 | This screenshot shows where the contents of the `Relevance` tags go.
20 |
21 | * Category - (Optional, defaults to `""`) (Permissible Values: any string) User-defined groupings (for example, "Licensing", "Update", "Computer Support")
22 | * DownloadSize - (Optional, defaults to `0`) (Permissible Values: any non-negative integer) The size of the download that this Fixlet will run.
23 | * Source - (Optional, defaults to `""`) (Permissible Values: any string) The organization or company that produced this Fixlet
24 | * SourceID - (Optional, defaults to `""`) (Permissible Values: any string) The ID of that organization or company
25 | * SourceReleaseDate - (Optional, defaults to `""`) (Permissible Values: any valid date in the format `yyyy-mm-dd`) The date this Fixlet was released
26 | * SourceSeverity - (Optional, defaults to `""`) (Permissible Values: any string) How important this Fixlet is (Critical, Moderate, etc.)
27 | * CVENames - (Optional, defaults to `""`) (Permissible Values: any string) The CVE (Common Vulnerabilities and Exposures) ID that this Fixlet addresses, if any
28 | * SANSID - (Optional, defaults to `""`) (Permissible Values: any string) The SANS ID that this Fixlet addresses, if any.
29 | * MimeField - (Optional)
30 | * Name - (Permissible values: any string)
31 | * Value - (Permissible values: any string)
32 | * Domain - (Optional) (Permissible Values: Exactly 4 basic Latin characters)
33 | * Delay - (Optional) (Permissible Values: strings matching the regular expression `P([0-9]+D)?(T([0-9]+H)?([0-9]+M)?([0-9]+(\.[0-9]{1,6})?S)?)?`)
34 |
35 | 
36 | This screenshot shows other properties that the fixlet can have.
37 |
38 | * DefaultAction - (Optional; if omitted then no default action set) The Action to take by default (select the "This action is the default action" checkbox; bolded in the "Take Action" menu)
39 | * _Attribute "ID"_ - (Permissible Values: any string) The name of this action. In the console, this is automatically be set to something like `Action1`.
40 | * Description - (Optional, defaults to `""`) The text that appears in the Actions box of the Description tab of a Fixlet. Clicking on the link will initiate the "Take Action" dialog box
41 | * PreLink - (Permissible Values: any string) The text that comes before the link
42 | * Link - (Permissible Values: any string) The text that will be a link
43 | * PostLink - (Permissible Values: any string) The text after the link
44 | * ActionScript - (Permissible Values: any ActionScript)
45 | * _Attribute "MIMEType"_ - (Optional, defaults to BigFix ActionScript)
46 | * Action - (Optional, Repeatable; if omitted then no default action set) An Action that this Fixlet can take. Any number of these tags can appear; each will create a separate Action.
47 | * _Attribute "ID"_ - (Permissible Values: any string) The name of this action. In the console, this is automatically be set to something like `Action1`.
48 | * Description - (Optional, defaults to `""`) The text that appears in the Actions box of the Description tab of a Fixlet. Clicking on the link will initiate the "Take Action" dialog box
49 | * PreLink - (Permissible Values: any string) The text that comes before the link
50 | * Link - (Permissible Values: any string) The text that will be a link
51 | * PostLink - (Permissible Values: any string) The text after the link
52 | * ActionScript - (Permissible Values: any ActionScript)
53 | * _Attribute "MIMEType"_ - (Optional, defaults to BigFix ActionScript)
54 |
55 | 
56 | This screenshot shows the actions in this fixlet (there is only one, in this case). Notice that the `This action is the default action` button is checked; this is because the action was declared in a `DefaultAction` tag, rather than an `Action` tag. The `MIMEType` attribute of the `ActionScript` tag determines the script type.
57 |
58 | Usage
59 | ---
60 |
61 | This command will PUT the `fixlet.xml` file onto the server, updating a fixlet
62 | on the master action site whose fixlet ID is `37`.
63 |
64 | curl -X PUT --data-binary @fixlet.xml --user username:password https://server:port/api/fixlet/master/37
65 |
66 | See [cURL overview](../../README.md#cURL) for more information on using cURL.
67 |
--------------------------------------------------------------------------------
/update-fixlet/cURL/fixlet.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Shutdown Clients with Outdated Versions
5 |
Shutdown all clients with a version older than 9.0.
7 | ]]>
8 | exists relay service OR exists main gather service
9 |
10 | Support
11 | 0
12 | BigFix
13 | ]]>
14 | 2004-10-06
15 | Critical
16 |
17 |
18 | Click
19 | here
20 | to shutdown outdated clients.
21 |
22 | shutdown
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/update-fixlet/img/edit-fixlet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigfix/restapi-examples/a3b4c1118bb1415200031f3ec8f30015c11eaffe/update-fixlet/img/edit-fixlet.png
--------------------------------------------------------------------------------
/update-fixlet/img/update-fixlet-actions.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigfix/restapi-examples/a3b4c1118bb1415200031f3ec8f30015c11eaffe/update-fixlet/img/update-fixlet-actions.png
--------------------------------------------------------------------------------
/update-fixlet/img/update-fixlet-description.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigfix/restapi-examples/a3b4c1118bb1415200031f3ec8f30015c11eaffe/update-fixlet/img/update-fixlet-description.png
--------------------------------------------------------------------------------
/update-fixlet/img/update-fixlet-properties.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigfix/restapi-examples/a3b4c1118bb1415200031f3ec8f30015c11eaffe/update-fixlet/img/update-fixlet-properties.png
--------------------------------------------------------------------------------
/update-fixlet/img/update-fixlet-relevance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bigfix/restapi-examples/a3b4c1118bb1415200031f3ec8f30015c11eaffe/update-fixlet/img/update-fixlet-relevance.png
--------------------------------------------------------------------------------
/update-operator/README.md:
--------------------------------------------------------------------------------
1 | https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Operator
2 |
--------------------------------------------------------------------------------
/update-operator/cURL/README.md:
--------------------------------------------------------------------------------
1 | This command will POST the file `operator.xml` to the server to update the operator named `eddard`:
2 |
3 | curl -X POST --data-binary @operator.xml --user username:password https://server:port/api/operator/eddard
4 |
5 | See [cURL overview](../../README.md#cURL) for more information on using [cURL](http://curl.haxx.se/).
6 |
--------------------------------------------------------------------------------
/update-operator/cURL/operator.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | testing...
5 | winterfell
6 | true
7 | true
8 | Unrestricted
9 | ShowAll
10 |
11 |
12 |
--------------------------------------------------------------------------------
/update-role/README.md:
--------------------------------------------------------------------------------
1 | https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Role
2 |
--------------------------------------------------------------------------------
/update-role/cURL/README.md:
--------------------------------------------------------------------------------
1 | Usage
2 | ---
3 |
4 | This command will PUT `role.xml` onto the server, updating details of the role whose ID is `35`.
5 |
6 | curl -X PUT --data-binary @role.xml --user username:password https://server:port/api/role/35
7 |
8 | See [cURL overview](../../README.md#cURL) for more information on using [cURL](http://curl.haxx.se/).
9 |
--------------------------------------------------------------------------------
/update-role/cURL/role.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Updated Role Name
4 | 35
5 | 1
6 | 1
7 | 1
8 | ShowNone
9 |
10 |
--------------------------------------------------------------------------------
/update-site/README.md:
--------------------------------------------------------------------------------
1 | https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Site
2 |
--------------------------------------------------------------------------------
/update-site/cURL/README.md:
--------------------------------------------------------------------------------
1 | Usage
2 | ---
3 |
4 | This command will update the CustomSite named `MySite` to specifications detailed in `site.xml`.
5 |
6 | curl -X POST --data-binary @site.xml --user username:password https://server:port/api/site/custom/MySite
7 |
8 | See [cURL overview](../../README.md#cURL) for more information on using [cURL](http://curl.haxx.se/).
9 |
--------------------------------------------------------------------------------
/update-site/cURL/site.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | New Custom Site Name
5 | A more detailed description about this site!
6 | BESC
7 | false
8 |
9 | Custom
10 |
11 |
12 | true
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/upload-file/README.md:
--------------------------------------------------------------------------------
1 | https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli%20Endpoint%20Manager/page/RESTAPI%20Upload
2 |
--------------------------------------------------------------------------------
/upload-file/cURL/README.md:
--------------------------------------------------------------------------------
1 | Usage
2 | ---
3 |
4 | This command will upload multiple files to the server. Additional files can be added using -F.
5 |
6 | curl --user username:password -F file=@file1.txt -F file=@file2.txt "https://server:port/api/upload"
7 |
8 | See [cURL overview](../../README.md#cURL) for more information on using [cURL](http://curl.haxx.se/).
--------------------------------------------------------------------------------
/upload-file/cURL/stuff.txt:
--------------------------------------------------------------------------------
1 | there is stuff in here
--------------------------------------------------------------------------------
/upload-file/cURL/stuff2.txt:
--------------------------------------------------------------------------------
1 | blahblahbalbhalbhablh
--------------------------------------------------------------------------------
/upload-file/cURL/stuff3.txt:
--------------------------------------------------------------------------------
1 | dkafjwel;fjaweo;joei;fjaweio
--------------------------------------------------------------------------------
/upload-file/cURL/stuff4.txt:
--------------------------------------------------------------------------------
1 | adsfjkoawejfaweojfiojaweiofjaweiljil
--------------------------------------------------------------------------------