Skip to content

Commit

Permalink
Adds graph schemaextension set command
Browse files Browse the repository at this point in the history
  • Loading branch information
ypcode committed Jan 27, 2020
1 parent 8355ae1 commit 8c55a67
Show file tree
Hide file tree
Showing 5 changed files with 774 additions and 0 deletions.
59 changes: 59 additions & 0 deletions docs/manual/docs/cmd/graph/schemaextension/schemaextension-set.md
@@ -0,0 +1,59 @@
# graph schemaextension set

Updates a Microsoft Graph schema extension

## Usage

```sh
graph schemaextension set [options]
```

## Options

Option|Description
------|-----------
`--help`|output usage information
`-i, --id <id>`|The unique identifier for the schema extension definition
`--owner`|The ID of the Azure AD application that is the owner of the schema extension
`-d, --description [description]`|Description of the schema extension
`-s, --status [status]`|The lifecycle state of the schema extension. Accepted values are 'Available' or 'Deprecated'
`-t, --targetTypes [targetTypes]`|Comma-separated list of Microsoft Graph resource types the schema extension targets
`-p, --properties [properties]`|The collection of property names and types that make up the schema extension definition formatted as a JSON string
`-o, --output [output]`|Output type. `json|text`. Default `text`
`--verbose`|Runs command with verbose logging
`--debug`|Runs command with debug logging

## Remarks

The lifecycle state of the schema extension. The initial state upon creation is `InDevelopment`.
Possible states transitions are from `InDevelopment` to `Available` and `Available` to `Deprecated`.
The target types are the set of Microsoft Graph resource types (that support schema extensions) that this schema extension definition can be applied to. This option is specified as a comma-separated list.
When specifying the JSON string of properties on Windows, you have to escape double quotes in a specific way. Considering the following value for the _properties_ option: `{"Foo":"Bar"}`,
you should specify the value as <code>\`"{""Foo"":""Bar""}"\`</code>.
In addition, when using PowerShell, you should use the `--%` argument.

## Examples

Update the description of a schema extension

```sh
graph schemaextension set --id MySchemaExtension --owner 62375ab9-6b52-47ed-826b-58e47e0e304b --description "My schema extension"
```

Update the target types and properties of a schema extension

```sh
graph schemaextension set --id contoso_MySchemaExtension --owner 62375ab9-6b52-47ed-826b-58e47e0e304b --targetTypes Group --properties \`"[{""name"":""myProp1"",""type"":""Integer""},{""name"":""myProp2"",""type"":""String""}]\`
```
Update the properties of a schema extension in PowerShell
```PowerShell
graph schemaextension set --id contoso_MySchemaExtension --owner 62375ab9-6b52-47ed-826b-58e47e0e304b --properties --% \`"[{""name"":""myProp1"",""type"":""Integer""},{""name"":""myProp2"",""type"":""String""}]\`
```

Change the status of a schema extension to 'Available'

```sh
graph schemaextension set --id contoso_MySchemaExtension --owner 62375ab9-6b52-47ed-826b-58e47e0e304b --status Available
```
1 change: 1 addition & 0 deletions docs/manual/mkdocs.yml
Expand Up @@ -73,6 +73,7 @@ nav:
- schemaextension add: 'cmd/graph/schemaextension/schemaextension-add.md'
- schemaextension get: 'cmd/graph/schemaextension/schemaextension-get.md'
- schemaextension remove: 'cmd/graph/schemaextension/schemaextension-remove.md'
- schemaextension set: 'cmd/graph/schemaextension/schemaextension-set.md'
- OneDrive (onedrive):
- report:
- report activityfilecounts: 'cmd/onedrive/report/report-activityfilecounts.md'
Expand Down
1 change: 1 addition & 0 deletions src/o365/graph/commands.ts
Expand Up @@ -4,4 +4,5 @@ export default {
SCHEMAEXTENSION_ADD: `${prefix} schemaextension add`,
SCHEMAEXTENSION_GET: `${prefix} schemaextension get`,
SCHEMAEXTENSION_REMOVE: `${prefix} schemaextension remove`,
SCHEMAEXTENSION_SET: `${prefix} schemaextension set`
};

0 comments on commit 8c55a67

Please sign in to comment.