diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_file_client.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_file_client.hpp index e55963b517..893fc7385a 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_file_client.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_file_client.hpp @@ -379,30 +379,6 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const UploadFileRangeFromUriOptions& options = UploadFileRangeFromUriOptions(), const Azure::Core::Context& context = Azure::Core::Context()) const; - /** - * @brief NFS only. Creates a symbolic link to the file specified by path. - * @param linkText The absolution or relative path to the file to be linked to. - * @param options Optional parameters to create this file's symbolic link. - * @param context Context for cancelling long running operations. - * @return Azure::Response containing the returned - * information. - */ - Azure::Response CreateSymbolicLink( - const std::string& linkText, - const CreateSymbolicLinkOptions& options = CreateSymbolicLinkOptions(), - const Azure::Core::Context& context = Azure::Core::Context()) const; - - /** - * @brief NFS only. Reads the value of the symbolic link. - * @param options Optional parameters to get this file's symbolic link. - * @param context Context for cancelling long running operations. - * @return Azure::Response containing the returned - * information. - */ - Azure::Response GetSymbolicLink( - const GetSymbolicLinkOptions& options = GetSymbolicLinkOptions(), - const Azure::Core::Context& context = Azure::Core::Context()) const; - /** * @brief NFS only. Creates a hard link to the file specified by path. * @param targetFile Path of the file to create the hard link to, not including the share. diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp index ed54c7f5c9..ae6afebfaf 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp @@ -1387,53 +1387,6 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { }; - /** - * @brief Optional parameters for - * #Azure::Storage::Files::Shares::ShareFileClient::CreateSymbolicLink. - */ - struct CreateSymbolicLinkOptions final - { - /** - * A name-value pair to associate with a file storage object. - */ - Storage::Metadata Metadata; - - /** - * Creation time for the file or directory. - */ - Nullable CreatedOn; - - /** - * Last write time for the file or directory. - */ - Nullable LastWrittenOn; - - /** - * Specify the access condition for the path. - */ - LeaseAccessConditions AccessConditions; - - /** - * NFS only. The owner user identifier (UID) to be set on the symbolic link. The default value - * is 0 (root). - */ - Nullable Owner; - - /** - * NFS only. The owner group identifier (GID) to be set on the symbolic link. The default value - * is 0 (root group). - */ - Nullable Group; - }; - - /** - * @brief Optional parameters for - * #Azure::Storage::Files::Shares::ShareFileClient::GetSymbolicLink. - */ - struct GetSymbolicLinkOptions final - { - }; - /** * @brief Optional parameters for * #Azure::Storage::Files::Shares::ShareFileClient::CreateHardLink. diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_responses.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_responses.hpp index 450d958bfe..53d25e69df 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_responses.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_responses.hpp @@ -591,55 +591,6 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { FilePosixProperties NfsProperties; }; - /** - * @brief Response type for #Azure::Storage::Files::Shares::ShareFileClient::CreateSymbolicLink. - */ - struct CreateFileSymbolicLinkResult final - { - /** - * The ETag contains a value which represents the version of the file, in quotes. - */ - Azure::ETag ETag; - - /** - * Returns the date and time the share was last modified. Any operation that modifies the - * directory or its properties updates the last modified time. Operations on files do not - * affect the last modified time of the directory. - */ - DateTime LastModified; - - /** - * The SMB related properties for the file. - */ - FileSmbProperties SmbProperties; - - /** - * The NFS related properties for the file. - */ - FilePosixProperties NfsProperties; - }; - /** - * @brief Response type for #Azure::Storage::Files::Shares::ShareFileClient::GetSymbolicLink. - */ - struct GetFileSymbolicLinkResult final - { - /** - * The ETag contains a value which represents the version of the file, in quotes. - */ - Azure::ETag ETag; - /** - * Returns the date and time the share was last modified. Any operation that modifies the - * directory or its properties updates the last modified time. Operations on files do not - * affect the last modified time of the directory. - */ - DateTime LastModified; - /** - * The path to the original file, the symbolic link is pointing to. The path is of type - * string which is not resolved and is stored as is. The path can be absolute path or the - * relative path depending on the content stored in the symbolic link file. - */ - std::string LinkText; - }; /** * @brief Response type for #Azure::Storage::Files::Shares::ShareFileClient::CreateHardLink. */ diff --git a/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp index e035650494..7efd9c981f 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_file_client.cpp @@ -1434,65 +1434,6 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { *m_pipeline, m_shareFileUrl, protocolLayerOptions, context); } - Azure::Response ShareFileClient::CreateSymbolicLink( - const std::string& linkText, - const CreateSymbolicLinkOptions& options, - const Azure::Core::Context& context) const - { - _detail::FileClient::CreateFileSymbolicLinkOptions protocolLayerOptions; - protocolLayerOptions.LinkText = linkText; - if (options.CreatedOn.HasValue()) - { - protocolLayerOptions.FileCreationTime = options.CreatedOn.Value().ToString( - Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits); - } - - if (options.LastWrittenOn.HasValue()) - { - protocolLayerOptions.FileLastWriteTime = options.LastWrittenOn.Value().ToString( - Azure::DateTime::DateFormat::Rfc3339, DateTime::TimeFractionFormat::AllDigits); - } - - protocolLayerOptions.FileRequestIntent = m_shareTokenIntent; - protocolLayerOptions.Owner = options.Owner; - protocolLayerOptions.Group = options.Group; - protocolLayerOptions.Metadata - = std::map(options.Metadata.begin(), options.Metadata.end()); - protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId; - - auto response = _detail::FileClient::CreateSymbolicLink( - *m_pipeline, m_shareFileUrl, protocolLayerOptions, context); - - Models::CreateFileSymbolicLinkResult ret; - ret.ETag = std::move(response.Value.ETag); - ret.SmbProperties = std::move(response.Value.SmbProperties); - ret.LastModified = std::move(response.Value.LastModified); - ret.NfsProperties.FileMode = Models::NfsFileMode::ParseOctalFileMode(response.Value.FileMode); - ret.NfsProperties.Owner = std::move(response.Value.Owner); - ret.NfsProperties.Group = std::move(response.Value.Group); - ret.NfsProperties.NfsFileType = std::move(response.Value.NfsFileType); - return Azure::Response( - std::move(ret), std::move(response.RawResponse)); - } - - Azure::Response ShareFileClient::GetSymbolicLink( - const GetSymbolicLinkOptions& options, - const Azure::Core::Context& context) const - { - (void)options; - _detail::FileClient::GetFileSymbolicLinkOptions protocolLayerOptions; - protocolLayerOptions.FileRequestIntent = m_shareTokenIntent; - auto response = _detail::FileClient::GetSymbolicLink( - *m_pipeline, m_shareFileUrl, protocolLayerOptions, context); - - Models::GetFileSymbolicLinkResult ret; - ret.ETag = std::move(response.Value.ETag); - ret.LastModified = std::move(response.Value.LastModified); - ret.LinkText = std::move(response.Value.LinkText); - return Azure::Response( - std::move(ret), std::move(response.RawResponse)); - } - Azure::Response ShareFileClient::CreateHardLink( const std::string& targetFile, const CreateHardLinkOptions& options, diff --git a/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp b/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp index edea8bf39b..c94597d191 100644 --- a/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/ut/share_file_client_test.cpp @@ -2328,55 +2328,6 @@ namespace Azure { namespace Storage { namespace Test { setOptions.NfsProperties.Owner.Value()); EXPECT_TRUE(downloadToResult.Details.NfsProperties.LinkCount.HasValue()); - // Create SymbolicLink - std::string sourceUrl = fileClient.GetUrl(); - auto symbolicLinkClient - = shareClient.GetRootDirectoryClient().GetFileClient(LowercaseRandomString()); - Files::Shares::CreateSymbolicLinkOptions createSymbolicLinkOptions; - createSymbolicLinkOptions.CreatedOn = otherProperties.SmbProperties.CreatedOn; - createSymbolicLinkOptions.LastWrittenOn = otherProperties.SmbProperties.LastWrittenOn; - - createSymbolicLinkOptions.Metadata = RandomMetadata(); - createSymbolicLinkOptions.Group = "123"; - createSymbolicLinkOptions.Owner = "456"; - Files::Shares::Models::CreateFileSymbolicLinkResult createSymbolicLinkResult; - EXPECT_NO_THROW( - createSymbolicLinkResult - = symbolicLinkClient.CreateSymbolicLink(sourceUrl, createSymbolicLinkOptions).Value); - EXPECT_TRUE(createSymbolicLinkResult.NfsProperties.FileMode.HasValue()); - EXPECT_EQ(createSymbolicLinkResult.NfsProperties.FileMode.Value().ToOctalFileMode(), octalMode); - EXPECT_TRUE(createSymbolicLinkResult.NfsProperties.Group.HasValue()); - EXPECT_EQ( - createSymbolicLinkResult.NfsProperties.Group.Value(), - createSymbolicLinkOptions.Group.Value()); - EXPECT_TRUE(createSymbolicLinkResult.NfsProperties.FileMode.HasValue()); - EXPECT_EQ( - createSymbolicLinkResult.NfsProperties.Owner.Value(), - createSymbolicLinkOptions.Owner.Value()); - EXPECT_TRUE(createSymbolicLinkResult.NfsProperties.NfsFileType.HasValue()); - EXPECT_EQ( - createSymbolicLinkResult.NfsProperties.NfsFileType.Value(), - Files::Shares::Models::NfsFileType::SymLink); - EXPECT_EQ( - createSymbolicLinkResult.SmbProperties.CreatedOn.Value(), - createSymbolicLinkOptions.CreatedOn.Value()); - EXPECT_EQ( - createSymbolicLinkResult.SmbProperties.LastWrittenOn.Value(), - createSymbolicLinkOptions.LastWrittenOn.Value()); - EXPECT_TRUE(createSymbolicLinkResult.SmbProperties.ChangedOn.HasValue()); - EXPECT_TRUE(!createSymbolicLinkResult.SmbProperties.FileId.empty()); - EXPECT_TRUE(!createSymbolicLinkResult.SmbProperties.ParentFileId.empty()); - EXPECT_TRUE(createSymbolicLinkResult.ETag.HasValue()); - - // Get SymbolicLink - Files::Shares::Models::GetFileSymbolicLinkResult getSymbolicLinkResult; - EXPECT_NO_THROW(getSymbolicLinkResult = symbolicLinkClient.GetSymbolicLink().Value); - EXPECT_TRUE(getSymbolicLinkResult.ETag.HasValue()); - if (!m_testContext.IsPlaybackMode()) - { - EXPECT_EQ(getSymbolicLinkResult.LinkText, sourceUrl); - } - // Create HardLink auto hardLinkClient = shareClient.GetRootDirectoryClient().GetFileClient(LowercaseRandomString()); @@ -2401,10 +2352,10 @@ namespace Azure { namespace Storage { namespace Test { Files::Shares::Models::NfsFileType::Regular); EXPECT_TRUE(createFileHardLinkResult.SmbProperties.CreatedOn.HasValue()); EXPECT_TRUE(createFileHardLinkResult.SmbProperties.LastWrittenOn.HasValue()); - EXPECT_TRUE(createSymbolicLinkResult.SmbProperties.ChangedOn.HasValue()); - EXPECT_TRUE(!createSymbolicLinkResult.SmbProperties.FileId.empty()); - EXPECT_TRUE(!createSymbolicLinkResult.SmbProperties.ParentFileId.empty()); - EXPECT_TRUE(createSymbolicLinkResult.ETag.HasValue()); + EXPECT_TRUE(createFileHardLinkResult.SmbProperties.ChangedOn.HasValue()); + EXPECT_TRUE(!createFileHardLinkResult.SmbProperties.FileId.empty()); + EXPECT_TRUE(!createFileHardLinkResult.SmbProperties.ParentFileId.empty()); + EXPECT_TRUE(createFileHardLinkResult.ETag.HasValue()); // Delete Files::Shares::Models::DeleteFileResult deleteResult;