Skip to content

Commit f366ea7

Browse files
committed
Adds spp model apply command. Closes pnp#6119
1 parent b184dfb commit f366ea7

File tree

6 files changed

+759
-0
lines changed

6 files changed

+759
-0
lines changed
+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import Global from '/docs/cmd/_global.mdx';
2+
import Tabs from '@theme/Tabs';
3+
import TabItem from '@theme/TabItem';
4+
5+
# spp model apply
6+
7+
Applies (or syncs) a trained document understanding model to a document library
8+
9+
## Usage
10+
11+
```sh
12+
m365 spp model apply [options]
13+
```
14+
15+
## Options
16+
17+
```md definition-list
18+
`-u, --siteUrl <siteUrl>`
19+
: The URL of the site where the library is located.
20+
21+
`--contentCenterUrl <contentCenterUrl>`
22+
: The URL of the content center site where model is located.
23+
24+
`-i, --id [id]`
25+
: The unique ID of the model to delete. Specify either `id` or `title` but not both.
26+
27+
`-t, --title [title]`
28+
: The display name (case-sensitive) of the model to apply. Specify either `id` or `title` but not both.
29+
30+
`--listTitle [listTitle]`
31+
: The title of the library on which to apply the model. Specify either `listTitle`, `listId`, or `listUrl` but not multiple.
32+
33+
`--listId [listId]`
34+
: The ID of the library on which to apply the model. Specify either `listTitle`, `listId`, or `listUrl` but not multiple.
35+
36+
`--listUrl [listUrl]`
37+
: Server or web-relative URL of the library on which to apply the model. Specify either `listTitle`, `listId`, or `listUrl` but not multiple.
38+
39+
`--viewOption [viewOption]`
40+
: Specifies whether to set the new model view as the default view of the library. Allowed values `NewViewAsDefault`, `DoNotChangeDefault`, `TileViewAsDefault`.
41+
```
42+
43+
<Global />
44+
45+
## Examples
46+
47+
Applies a trained document understanding model by id to a document library based on the list title.
48+
49+
```sh
50+
m365 spp model apply --siteUrl "https://contoso.sharepoint.com" --contentCenterUrl "https://contoso.sharepoint.com/sites/ContentCenter" --id "7645e69d-21fb-4a24-a17a-9bdfa7cb63dc" --listTitle "Shared Documents"
51+
```
52+
53+
Applies a trained document understanding model by title to a document library based on the list title.
54+
55+
```sh
56+
m365 spp model apply --siteUrl "https://contoso.sharepoint.com" --contentCenterUrl "https://contoso.sharepoint.com/sites/ContentCenter" --title "ModelExample" --listTitle "Shared Documents"
57+
```
58+
59+
Applies a trained document understanding model by title to a document library based on the list url.
60+
61+
```sh
62+
m365 spp model apply --siteUrl "https://contoso.sharepoint.com" --contentCenterUrl "https://contoso.sharepoint.com/sites/ContentCenter" --title "ModelExample" --listUrl "/Shared Documents"
63+
```
64+
65+
Applies a trained document understanding model by title to a document library based on the list id.
66+
67+
```sh
68+
m365 spp model apply --siteUrl "https://contoso.sharepoint.com" --contentCenterUrl "https://contoso.sharepoint.com/sites/ContentCenter" --title "ModelExample" --listId "b4cfa0d9-b3d7-49ae-a0f0-f14ffdd005f7"
69+
```
70+
71+
## Response
72+
73+
The command won't return a response on success.

docs/src/config/sidebars.ts

+5
Original file line numberDiff line numberDiff line change
@@ -3975,6 +3975,11 @@ const sidebars: SidebarsConfig = {
39753975
},
39763976
{
39773977
model: [
3978+
{
3979+
type: 'doc',
3980+
label: 'model apply',
3981+
id: 'cmd/spp/model/model-apply'
3982+
},
39783983
{
39793984
type: 'doc',
39803985
label: 'model list',

src/m365/spp/commands.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ const prefix: string = 'spp';
22

33
export default {
44
CONTENTCENTER_LIST: `${prefix} contentcenter list`,
5+
MODEL_APPLY: `${prefix} model apply`,
56
MODEL_LIST: `${prefix} model list`
67
};

0 commit comments

Comments
 (0)