Пространство имен: microsoft.graph
Обновите свойства объекта fileStorageContainerType . Обновленные свойства отражаются в каждом зарегистрированном файлеStorageContainerTypeRegistration не более чем за 24 часа. Параметры, переопределенные в клиенте, не обновляются.
Примечание. При обновлении параметров поведение любого нового fileStorageContainer изменяется, но существующие контейнеры могут требовать обновления их параметров напрямую или не обновляться. например, размер хранилища.
ETag используется для управления оптимистическим параллелизмом. Он должен совпадать со значением из команды Создать, Получить или предыдущее обновление.
Этот API доступен в следующих национальных облачных развертываниях.
| Глобальная служба |
Правительство США L4 |
Правительство США L5 (DOD) |
Китай управляется 21Vianet |
| ✅ |
✅ |
✅ |
✅ |
Разрешения
Выберите разрешение или разрешения, помеченные как наименее привилегированные для этого API. Используйте более привилегированное разрешение или разрешения только в том случае, если это требуется приложению. Дополнительные сведения о делегированных разрешениях и разрешениях приложений см. в разделе Типы разрешений. Дополнительные сведения об этих разрешениях см. в справочнике по разрешениям.
| Тип разрешения |
Разрешения с наименьшими привилегиями |
Более высокие привилегированные разрешения |
| Делегированные (рабочая или учебная учетная запись) |
FileStorageContainerType.Manage.All |
Недоступно. |
| Делегированные (личная учетная запись Майкрософт) |
Не поддерживается. |
Не поддерживается. |
| Для приложений |
Не поддерживается. |
Не поддерживается. |
HTTP-запрос
PATCH /storage/fileStorage/containerTypes/{fileStorageContainerTypeId}
Текст запроса
В тексте запроса укажите только значения свойств для обновления. Существующие свойства, которые не включены в текст запроса, сохраняют свои предыдущие значения или пересчитываются на основе изменений других значений свойств.
В следующей таблице указаны свойства, которые можно обновить.
| Свойство |
Тип |
Описание |
| name |
String |
Имя fileStorageContainerType. Необязательный параметр. |
| settings |
fileStorageContainerTypeSettings |
fileStorageContainerType settings. Необязательный параметр. |
| etag |
String |
Используется для управления оптимистическим параллелизмом. Должно соответствовать значению, возвращенное запросом Create или Get . Обязательно. |
Отклик
В случае успешного 200 OK выполнения этот метод возвращает код ответа и обновленный объект fileStorageContainerType в тексте ответа.
Примеры
Пример 1. Обновление файлаStorageContainerType
В следующем примере показано, как обновить fileStorageContainerType.
Запрос
Ниже показан пример запроса.
PATCH https://graph.microsoft.com/v1.0/storage/fileStorage/containerTypes/de988700-d700-020e-0a00-0831f3042f00
Content-Type: application/json
{
"settings": {
"urlTemplate": "https://app.contoso.com/redirect?tenant={tenant-id}&drive={drive-id}&folder={folder-id}&item={item-id}",
"isItemVersioningEnabled": true,
"isSharingRestricted": false
},
"etag": "RVRhZw=="
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new FileStorageContainerType
{
Settings = new FileStorageContainerTypeSettings
{
UrlTemplate = "https://app.contoso.com/redirect?tenant={tenant-id}&drive={drive-id}&folder={folder-id}&item={item-id}",
IsItemVersioningEnabled = true,
IsSharingRestricted = false,
},
Etag = "RVRhZw==",
};
// To initialize your graphClient, see https://dori-uw-1.kuma-moon.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Storage.FileStorage.ContainerTypes["{fileStorageContainerType-id}"].PatchAsync(requestBody);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewFileStorageContainerType()
settings := graphmodels.NewFileStorageContainerTypeSettings()
urlTemplate := "https://app.contoso.com/redirect?tenant={tenant-id}&drive={drive-id}&folder={folder-id}&item={item-id}"
settings.SetUrlTemplate(&urlTemplate)
isItemVersioningEnabled := true
settings.SetIsItemVersioningEnabled(&isItemVersioningEnabled)
isSharingRestricted := false
settings.SetIsSharingRestricted(&isSharingRestricted)
requestBody.SetSettings(settings)
etag := "RVRhZw=="
requestBody.SetEtag(&etag)
// To initialize your graphClient, see https://dori-uw-1.kuma-moon.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
containerTypes, err := graphClient.Storage().FileStorage().ContainerTypes().ByFileStorageContainerTypeId("fileStorageContainerType-id").Patch(context.Background(), requestBody, nil)
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
FileStorageContainerType fileStorageContainerType = new FileStorageContainerType();
FileStorageContainerTypeSettings settings = new FileStorageContainerTypeSettings();
settings.setUrlTemplate("https://app.contoso.com/redirect?tenant={tenant-id}&drive={drive-id}&folder={folder-id}&item={item-id}");
settings.setIsItemVersioningEnabled(true);
settings.setIsSharingRestricted(false);
fileStorageContainerType.setSettings(settings);
fileStorageContainerType.setEtag("RVRhZw==");
FileStorageContainerType result = graphClient.storage().fileStorage().containerTypes().byFileStorageContainerTypeId("{fileStorageContainerType-id}").patch(fileStorageContainerType);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
const options = {
authProvider,
};
const client = Client.init(options);
const fileStorageContainerType = {
settings: {
urlTemplate: 'https://app.contoso.com/redirect?tenant={tenant-id}&drive={drive-id}&folder={folder-id}&item={item-id}',
isItemVersioningEnabled: true,
isSharingRestricted: false
},
etag: 'RVRhZw=='
};
await client.api('/storage/fileStorage/containerTypes/de988700-d700-020e-0a00-0831f3042f00')
.update(fileStorageContainerType);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\FileStorageContainerType;
use Microsoft\Graph\Generated\Models\FileStorageContainerTypeSettings;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new FileStorageContainerType();
$settings = new FileStorageContainerTypeSettings();
$settings->setUrlTemplate('https://app.contoso.com/redirect?tenant={tenant-id}&drive={drive-id}&folder={folder-id}&item={item-id}');
$settings->setIsItemVersioningEnabled(true);
$settings->setIsSharingRestricted(false);
$requestBody->setSettings($settings);
$requestBody->setEtag('RVRhZw==');
$result = $graphServiceClient->storage()->fileStorage()->containerTypes()->byFileStorageContainerTypeId('fileStorageContainerType-id')->patch($requestBody)->wait();
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.file_storage_container_type import FileStorageContainerType
from msgraph.generated.models.file_storage_container_type_settings import FileStorageContainerTypeSettings
# To initialize your graph_client, see https://dori-uw-1.kuma-moon.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = FileStorageContainerType(
settings = FileStorageContainerTypeSettings(
url_template = "https://app.contoso.com/redirect?tenant={tenant-id}&drive={drive-id}&folder={folder-id}&item={item-id}",
is_item_versioning_enabled = True,
is_sharing_restricted = False,
),
etag = "RVRhZw==",
)
result = await graph_client.storage.file_storage.container_types.by_file_storage_container_type_id('fileStorageContainerType-id').patch(request_body)
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
Отклик
Ниже показан пример отклика.
Примечание. Объект отклика, показанный здесь, может быть сокращен для удобочитаемости.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.fileStorageContainerType",
"id": "de988700-d700-020e-0a00-0831f3042f00",
"name": "Container Type Name",
"owningAppId": "11335700-9a00-4c00-84dd-0c210f203f00",
"billingClassification": "trial",
"billingStatus": "valid",
"createdDateTime": "01/20/2025",
"expirationDateTime": "02/20/2025",
"etag": "RVRhZyArIDE=",
"settings": {
"urlTemplate": "https://app.contoso.com/redirect?tenant={tenant-id}&drive={drive-id}&folder={folder-id}&item={item-id}",
"isDiscoverabilityEnabled": true,
"isSearchEnabled": true,
"isItemVersioningEnabled": true,
"itemMajorVersionLimit": 50,
"maxStoragePerContainerInBytes": 104857600,
"isSharingRestricted": false,
"consumingTenantOverridables": ""
}
}
Пример 2. Обновление fileStorageContainerType без ETag
В следующем примере показано, как обновить fileStorageContainerType без etag.
Запрос
Ниже показан пример запроса.
PATCH https://graph.microsoft.com/v1.0/storage/fileStorage/containerTypes/de988700-d700-020e-0a00-0831f3042f00
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.fileStorageContainerType",
"settings": {
"urlTemplate": "https://app.contoso.com/redirect?tenant={tenant-id}&drive={drive-id}&folder={folder-id}&item={item-id}",
"isItemVersioningEnabled": true,
"isSharingRestricted": false
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new FileStorageContainerType
{
OdataType = "#microsoft.graph.fileStorageContainerType",
Settings = new FileStorageContainerTypeSettings
{
UrlTemplate = "https://app.contoso.com/redirect?tenant={tenant-id}&drive={drive-id}&folder={folder-id}&item={item-id}",
IsItemVersioningEnabled = true,
IsSharingRestricted = false,
},
};
// To initialize your graphClient, see https://dori-uw-1.kuma-moon.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Storage.FileStorage.ContainerTypes["{fileStorageContainerType-id}"].PatchAsync(requestBody);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewFileStorageContainerType()
settings := graphmodels.NewFileStorageContainerTypeSettings()
urlTemplate := "https://app.contoso.com/redirect?tenant={tenant-id}&drive={drive-id}&folder={folder-id}&item={item-id}"
settings.SetUrlTemplate(&urlTemplate)
isItemVersioningEnabled := true
settings.SetIsItemVersioningEnabled(&isItemVersioningEnabled)
isSharingRestricted := false
settings.SetIsSharingRestricted(&isSharingRestricted)
requestBody.SetSettings(settings)
// To initialize your graphClient, see https://dori-uw-1.kuma-moon.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
containerTypes, err := graphClient.Storage().FileStorage().ContainerTypes().ByFileStorageContainerTypeId("fileStorageContainerType-id").Patch(context.Background(), requestBody, nil)
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
FileStorageContainerType fileStorageContainerType = new FileStorageContainerType();
fileStorageContainerType.setOdataType("#microsoft.graph.fileStorageContainerType");
FileStorageContainerTypeSettings settings = new FileStorageContainerTypeSettings();
settings.setUrlTemplate("https://app.contoso.com/redirect?tenant={tenant-id}&drive={drive-id}&folder={folder-id}&item={item-id}");
settings.setIsItemVersioningEnabled(true);
settings.setIsSharingRestricted(false);
fileStorageContainerType.setSettings(settings);
FileStorageContainerType result = graphClient.storage().fileStorage().containerTypes().byFileStorageContainerTypeId("{fileStorageContainerType-id}").patch(fileStorageContainerType);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
const options = {
authProvider,
};
const client = Client.init(options);
const fileStorageContainerType = {
'@odata.type': '#microsoft.graph.fileStorageContainerType',
settings: {
urlTemplate: 'https://app.contoso.com/redirect?tenant={tenant-id}&drive={drive-id}&folder={folder-id}&item={item-id}',
isItemVersioningEnabled: true,
isSharingRestricted: false
}
};
await client.api('/storage/fileStorage/containerTypes/de988700-d700-020e-0a00-0831f3042f00')
.update(fileStorageContainerType);
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\FileStorageContainerType;
use Microsoft\Graph\Generated\Models\FileStorageContainerTypeSettings;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new FileStorageContainerType();
$requestBody->setOdataType('#microsoft.graph.fileStorageContainerType');
$settings = new FileStorageContainerTypeSettings();
$settings->setUrlTemplate('https://app.contoso.com/redirect?tenant={tenant-id}&drive={drive-id}&folder={folder-id}&item={item-id}');
$settings->setIsItemVersioningEnabled(true);
$settings->setIsSharingRestricted(false);
$requestBody->setSettings($settings);
$result = $graphServiceClient->storage()->fileStorage()->containerTypes()->byFileStorageContainerTypeId('fileStorageContainerType-id')->patch($requestBody)->wait();
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.file_storage_container_type import FileStorageContainerType
from msgraph.generated.models.file_storage_container_type_settings import FileStorageContainerTypeSettings
# To initialize your graph_client, see https://dori-uw-1.kuma-moon.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = FileStorageContainerType(
odata_type = "#microsoft.graph.fileStorageContainerType",
settings = FileStorageContainerTypeSettings(
url_template = "https://app.contoso.com/redirect?tenant={tenant-id}&drive={drive-id}&folder={folder-id}&item={item-id}",
is_item_versioning_enabled = True,
is_sharing_restricted = False,
),
)
result = await graph_client.storage.file_storage.container_types.by_file_storage_container_type_id('fileStorageContainerType-id').patch(request_body)
Подробнее о том, как добавить SDK в свой проект и создать экземпляр authProvider, см. в документации по SDK.
Отклик
Ниже приводится пример отклика.
HTTP/1.1 400 Bad Request