|
6 | 6 | -------
|
7 | 7 |
|
8 | 8 | The Socket.dev Python SDK provides a wrapper around the Socket.dev REST API to simplify making calls to the API from Python.
|
| 9 | +Socket API v0 - https://docs.socket.dev/reference/introduction-to-socket-api |
9 | 10 |
|
10 | 11 | Initializing the module
|
11 | 12 | -----------------------
|
@@ -256,4 +257,117 @@ Retrieve the package information for a purl post
|
256 | 257 | **PARAMETERS:**
|
257 | 258 |
|
258 | 259 | - **license (str)** - The license parameter if enabled will show alerts and license information. If disabled will only show the basic package metadata and scores. Default is true
|
259 |
| -- **components (array{dict})** - The components list of packages urls |
| 260 | +- **components (array{dict})** - The components list of packages urls |
| 261 | + |
| 262 | +fullscans.get(org_slug) |
| 263 | +"""""""""""""""""""""" |
| 264 | +Retrieve the Fullscans information for around Organization |
| 265 | + |
| 266 | +**Usage:** |
| 267 | + |
| 268 | +.. code-block:: |
| 269 | +
|
| 270 | + from socketdev import SocketDev |
| 271 | + socket = SocketDev("REPLACE_ME") |
| 272 | + print(socket.fullscans.get("org_slug")) |
| 273 | +
|
| 274 | +**PARAMETERS:** |
| 275 | + |
| 276 | +- **org_slug (str)** - The organization name |
| 277 | + |
| 278 | +fullscans.post(files, params) |
| 279 | +"""""""""""""""""""""" |
| 280 | +Create a full scan from a set of package manifest files. Returns a full scan including all SBOM artifacts. |
| 281 | + |
| 282 | +**Usage:** |
| 283 | + |
| 284 | +.. code-block:: |
| 285 | +
|
| 286 | + from socketdev import SocketDev |
| 287 | + socket = SocketDev("REPLACE_ME") |
| 288 | + files = [ |
| 289 | + "/path/to/manifest/package.json" |
| 290 | + ] |
| 291 | + params = { |
| 292 | + "org_slug": "org_name", |
| 293 | + "repo": "TestRepo", |
| 294 | + "branch": "main", |
| 295 | + "commit_message": "Test Commit Message", |
| 296 | + "commit_hash": "", |
| 297 | + "pull_request": "", |
| 298 | + "committers": "commiter", |
| 299 | + "make_default_branch": False, |
| 300 | + "set_as_pending_head": False, |
| 301 | + "tmp": "" |
| 302 | + } |
| 303 | +
|
| 304 | + print(socket.fullscans.post(files, params)) |
| 305 | +
|
| 306 | +**PARAMETERS:** |
| 307 | + |
| 308 | +- **files (list)** - List of file paths of manifest files |
| 309 | +- **params (dict)** - List of parameters to create a fullscan |
| 310 | + |
| 311 | +| Parameter | Required | Description | |
| 312 | +|:----------------------|:---------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------| |
| 313 | +| --org_slug | True | The string name in a git approved name for organization. | |
| 314 | +| --repo | True | The string name in a git approved name for repositories. | |
| 315 | +| --branch | False | The string name in a git approved name for branches. | |
| 316 | +| --committers | False | The string name of the person doing the commit or running the CLI. Can be specified multiple times to have more than one committer | |
| 317 | +| --pull_request | False | The integer for the PR or MR number | |
| 318 | +| --commit_message | False | The string for a commit message if there is one | |
| 319 | +| --make_default_branch | False | If the flag is specified this will signal that this is the default branch. | |
| 320 | +| --commit_hash | False | Optional git commit hash | |
| 321 | +| --set_as_pending_head | False | | |
| 322 | +| --tmp | False | | |
| 323 | +
|
| 324 | +fullscans.delete(org_slug, full_scan_id) |
| 325 | +"""""""""""""""""""""" |
| 326 | +Delete an existing full scan. |
| 327 | + |
| 328 | +**Usage:** |
| 329 | + |
| 330 | +.. code-block:: |
| 331 | +
|
| 332 | + from socketdev import SocketDev |
| 333 | + socket = SocketDev("REPLACE_ME") |
| 334 | + print(socket.fullscans.delete(org_slug, full_scan_id)) |
| 335 | +
|
| 336 | +**PARAMETERS:** |
| 337 | + |
| 338 | +- **org_slug (str)** - The organization name |
| 339 | +- **full_scan_id (str)** - The ID of the full scan |
| 340 | + |
| 341 | +fullscans.stream(org_slug, full_scan_id) |
| 342 | +"""""""""""""""""""""" |
| 343 | +Stream all SBOM artifacts for a full scan. |
| 344 | + |
| 345 | +**Usage:** |
| 346 | + |
| 347 | +.. code-block:: |
| 348 | +
|
| 349 | + from socketdev import SocketDev |
| 350 | + socket = SocketDev("REPLACE_ME") |
| 351 | + print(socket.fullscans.stream(org_slug, full_scan_id)) |
| 352 | +
|
| 353 | +**PARAMETERS:** |
| 354 | + |
| 355 | +- **org_slug (str)** - The organization name |
| 356 | +- **full_scan_id (str)** - The ID of the full scan |
| 357 | + |
| 358 | +fullscans.metadata(org_slug, full_scan_id) |
| 359 | +"""""""""""""""""""""" |
| 360 | +Get metadata for a single full scan |
| 361 | + |
| 362 | +**Usage:** |
| 363 | + |
| 364 | +.. code-block:: |
| 365 | +
|
| 366 | + from socketdev import SocketDev |
| 367 | + socket = SocketDev("REPLACE_ME") |
| 368 | + print(socket.fullscans.metadata(org_slug, full_scan_id)) |
| 369 | +
|
| 370 | +**PARAMETERS:** |
| 371 | + |
| 372 | +- **org_slug (str)** - The organization name |
| 373 | +- **full_scan_id (str)** - The ID of the full scan |
0 commit comments