huaweicloud / huaweicloud-sdk-dotnet-obs Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
目前用 .net standard 2.0 的类库 引入 sdk 报版本兼容问题
Hi;
I am triggering DeleteObject operation. Response objects StatusCode is always System.Net.HttpStatusCode.NoContent but it deletes the file.
File delete operation is successful.
The underlying connection was closed: An unexpected error occurred on a send,不是必现的,偶尔会出现这样的异常,请问该如何解决?
https://support.huaweicloud.com/sdk-dotnet-devg-obs/obs_25_0412.html
UploadProgress 中的Console输出,必须要等上传完成后,才会把上传过程依次打印出来。
除了放到另外的线程中,还有什么方法实时输出上传进度吗?就是不要卡死在华为的线程中...
// 注册上传进度回调函数
request.UploadProgress += delegate(object sender, TransferStatus status){
// 获取上传平均速率
Console.WriteLine("AverageSpeed: {0}", status.AverageSpeed / 1024 + "KB/S");
// 获取上传进度百分比
Console.WriteLine("TransferPercentage: {0}", status.TransferPercentage);
};
nuget中搜素有对应的nuget包,但是官网SDK文档中没有指出具体是哪一个?使用第三方包担心存在风险。请问该SDK有nuget包吗?
华为云OBS可以适配兼容dotnet的async/await的异步编程模型吗?回调函数太难用了
使用场景:每次上传未知数量的Dicom文件,几张-几千张不止,每个小文件也是100K到10M不止,使用了断点续传,因为客户网络不是很稳定。
出现问题:NoSuchUploadThe specified upload does not exist. The upload ID may be invalid, or the upload may have been aborted or completed.
但是呢,文件已经上传到OBS上了。
求如何解决?
版本3.20.7
完全用的官方代码测试的。
private static ObsClient client;
private static string bucketName = "my-obs-bucket-demo";
public void Setup(string accessKeyId, string secretAccessKey, string securityToken, string endPoint)
{
client = new ObsClient(accessKeyId, secretAccessKey, securityToken,endPoint);
}
static void CreateBucket()
{
try
{
CreateBucketRequest request = new CreateBucketRequest()
{
BucketName = bucketName
};
CreateBucketResponse response = client.CreateBucket(request);
Console.WriteLine("Create bucket response: {0}", response.StatusCode);
}
catch (ObsException ex)
{
Console.WriteLine("Exception errorcode: {0}, when create a bucket.", ex.ErrorCode);
Console.WriteLine("Exception errormessage: {0}", ex.ErrorMessage);
}
}
每次来下载,更新成本有点高
请问ObsClient适合用什么样的生命周期?
官方的文档和例子都没有一个说明?
单例?瞬时?还是作用域?
还有对于上传和下载的文件流,是否需要调用Dispose接口,释放非托管资源?官方文档也没有说清楚
分段上传,使用
obs3.+
,每段大小200KB
,上传到了指定桶中(通过工具桶碎片中有了对应的碎片),但是却在使用ObsClient.CompleteMultipartUpload合并段时,捕获到异常——Specified method is not supported
。
❓ 求解为什么会这样,官方文档上不是写支持最小
100KB
了么。
🙏 此外, 项目能否写的规范一点以及对象操作支持异步,最好能发布到nuget上。
1、创建Bucket代码:
var request = new CreateBucketRequest
{
BucketName = "0001"
};
var response = _client.CreateBucket(request);
2、发生ObsException错误 ErrorMessage:Specified method is not supported. , 此调用使用华南-广州区域,对应oss地址:https://obs.cn-south-1.myhuaweicloud.com
sdk:HuaweiCloud.OBS.SDK
version:3.20.7
platform:.net 7
问题:当设置防盗链时,实时预览没问题,api请求GetObject获取文件报错,禁用防盗链后请求成功。
ErrorMessage:Specified method is not supported.
StatusCode:Forbidden
问题点:请求头Headers缺少Referer参数,当我手动加上Referer参数后,api请求成功
请问除了这个方法之外,还有什么其他办法。
希望能在sdk中开放请求头参数。
ListObjectsRequest request = new ListObjectsRequest(); request.BucketName = bucketName; request.MaxKeys = 100; ListObjectsResponse response; do { response = client.ListObjects(request); foreach (ObsObject entry in response.ObsObjects) { ... } request.Marker = response.NextMarker; } while (response.IsTruncated);
do执行第二次时在 response = client.ListObjects(request); 处发生异常:
TargetInvocationException: 调用的目标发生了异常。
XmlException: “.”(十六进制值 0x00)是无效的字符。 第 1 行,位置 22383。
使用C# 3.20.7的SDK,每秒上传200个大概30K的文件,在上传8000多个对象后,就开始报错。内容是: Only one usage of each socket address (protocol/network address/port) is normally permitted.
网上查了下,大概是因为端口占用太多。
使用netstat -a查询,确实看到有大量端口连接到OBS,并处于TIME_WAIT状态。
等待两分钟后,又能继续上传。但上传8000+对象后,又继续报错。
是否是SDK里未及时关闭端口?
Details were metioned in #34 (comment).
Method reflection returns null
.
Hi;
Our company bought Huawei S3 storage and we want to use it. But this library very old and does not support the async/await task based approach.
Is it in development backlog. What is the estimated time of release?
Kind regards.
是否可以提供一个删除文件夹的接口
异步上传正常,异步下载报错,3.1版本和最新的3.20版本都报错
c#项目,首选32位,允许不安全代码
client.BeginGetObject(request, delegate (IAsyncResult ar) {
GetObjectResponse response = client.EndGetObject(ar);
}, null);ar报错,
AsyncWaitHandle “((OBS.Internal.ObsAsyncResult<OBS.Internal.HttpResponse>)ar).AsyncWaitHandle”引发了类型“System.ObjectDisposedException”的异常 System.Threading.WaitHandle {System.ObjectDisposedException}
未将对象引用设置到对象的实例
我就问问不允许子用户登录控制台的情况下,咋编程方式请求临时AK/SK 与 SecurityToken
obs sdk 上传文件区分大小写 大写不能识别 小写正常识别
怀疑是endpoint地址为https时发生错误
使用 netstandard2.0 而不是使用 .net core2.0 , 后续的 .net core3.1,.net core5, .net 6 都能直接使用。
obsclient的初始化,无法使用cname,python的sdk是可以的。能改进吗?
开发webapi,其中有接口通过OBS实现下载(返回GetObjectResponse.OutputStream),当客户端并发访问时,经常出现返回的文件不能正常读取
从nuget上搜索看到HuaweiCloud.SDK.OBS包名被占了,而且已经近三年没有更新过。除此之外,应该所有华为云的sdk都发到了nuget。为何不联系nuget将HuaweiCloud.SDK.OBS撤下来,然后由你们发布新的包。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.