/** * Uploads a new {@link ServiceProperties} configuration to the given storage service. This includes Logging, * HourMetrics, MinuteMetrics and CORS configurations. * * @param properties * A {@link ServiceProperties} object which specifies the service properties to upload. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public void uploadServiceProperties(final ServiceProperties properties) throws StorageException { this.uploadServiceProperties(properties, null /* options */, null /* opContext */); }
/** * Uploads a new {@link ServiceProperties} configuration to the given storage service. This includes Logging, * HourMetrics, MinuteMetrics and CORS configurations. * * @param properties * A {@link ServiceProperties} object which specifies the service properties to upload. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public void uploadServiceProperties(final ServiceProperties properties) throws StorageException { this.uploadServiceProperties(properties, null /* options */, null /* opContext */); }
blobServiceProperties.setCors(cors); blobClient.uploadServiceProperties(blobServiceProperties);
private void callUploadServiceProps( ServiceClient client, ServiceProperties props, FileServiceProperties fileProps) throws StorageException, InterruptedException { if (client.getClass().equals(CloudBlobClient.class)) { ((CloudBlobClient) client).uploadServiceProperties(props); } else if (client.getClass().equals(CloudTableClient.class)) { ((CloudTableClient) client).uploadServiceProperties(props); } else if (client.getClass().equals(CloudQueueClient.class)) { ((CloudQueueClient) client).uploadServiceProperties(props); } else if (client.getClass().equals(CloudFileClient.class)) { ((CloudFileClient) client).uploadServiceProperties(fileProps); } else { fail(); } Thread.sleep(30000); }
@Override public void setConfiguration(final Path container, final LoggingConfiguration configuration) throws BackgroundException { try { final ServiceProperties properties = session.getClient().downloadServiceProperties(null, context); final LoggingProperties l = new LoggingProperties(); if(configuration.isEnabled()) { l.setLogOperationTypes(EnumSet.allOf(LoggingOperations.class)); } else { l.setLogOperationTypes(EnumSet.noneOf(LoggingOperations.class)); } properties.setLogging(l); session.getClient().uploadServiceProperties(properties, null, context); } catch(StorageException e) { throw new AzureExceptionMappingService().map("Failure to write attributes of {0}", e, container); } } }