openstacknetsdk / openstack.net Goto Github PK
View Code? Open in Web Editor NEWAn OpenStack Cloud SDK for Microsoft .NET
Home Page: http://www.openstacknetsdk.org
License: Other
An OpenStack Cloud SDK for Microsoft .NET
Home Page: http://www.openstacknetsdk.org
License: Other
When IObjectStorageProvider.DisableCDNOnContainer
returns, is there any assurance that previously cached objects from the container are immediately inaccessible through the CDN? The documentation for this method should be updated to include the answer.
According to the documentation, services should be located by type, with the name only used as a tie-breaker.
I am using .net OpenStack SDK which was installed from NuGet. Version is 1.1.2.1
The following code I used to move/rename image:
CloudIdentity identity = new CloudIdentity() { APIKey = apiKey, Username = userName };
CloudFilesProvider Provider = new CloudFilesProvider(identity);
Provider.MoveObject("Test Container", "Chrysanthemum.jpg", "Test Container", "Test-2.jpg");
Result: All time I did it content type of image was changed from image/jpeg(Chrysanthemum.jpg) to application/json(Test-2.jpg). That mean browser can't correctly render my image.
On the morning of Saturday, March 23, 2013, the 'rackspace' organization on GitHub will be reorganized. All repos will be moved to the new 'rackerlabs' organization, except for those that are designed to be used by Rackspace customers and which are fully supported.
Please update any links to this repo to reflect the new location within GitHub. For example, if the link to your repo is 'https://github.com/rackspace/foo', you need to change it to 'https://github.com/rackerlabs/foo'.
When referencing openstacknet.dll (downloaded via nuget) from a signed assembly, I get a compile error "Assembly generation failed -- Referenced assembly 'openstacknet' does not have a strong name." For our scenario we'll need to either load dynamically or sign/recompile openstacknet.dll. Is there some reason why the compiled dll is not signed?
The VolumeType.Id
property should be a string
, not an int
. As-is, the call to IBlockStorageProvider.DescribeVolumeType
and IBlockStorageProvider.ListVolumeTypes
are unusable.
Commit 799f37c introduced a bug in CloudFilesProvider
, and now GetObject
doesn't return any data.
If a metadata key named x-container-meta-XXX
is provided to CloudFilesProvider.UpdateContainerMetadata
, it is added to the outgoing HTTP headers as-is. This results in the metadata key being returned from GetContainerMetadata
as XXX
instead of the expected value x-container-meta-XXX
.
CloudFilesProvider.UpdateContainerMetadata
should not include special cases for these keys, as it breaks the documented abstraction layer of the SDK.
The following methods are all affected by an equivalent bug:
UpdateContainerMetadata
DeleteContainerMetadata
UpdateObjectMetadata
UpdateAccountMetadata
Hello folks, I've just arrived at this group after being redirected here now that the csharp-xxx projects I was using a year ago are deprecated.
I was just running some sanity tests by using the nuget package on a VS2012 project. The new API seems sensible and easy to use and I was going well until I found that ListObjects fails with ItemNotFoundException on a container name with spaces. The source code seems to be escaping the name so I'm not sure what's wrong. Any ideas anyone? -- Cheers, Greg
Migrated from rackspace#14.
Is this SDK only for public rackspace?
On openstack.org it forwards me to this SDK to use..
Thanks.
Question: In my old apps using the old API I would reuse the authenticate token like this:
credentials = new UserCredentials(username, apikey);
connect = new CF_Connection(credentials);
connect.Authenticate();
// SAVE credentials.AuthToken and credentials.StorageUrl
Later I would check if the saved token and url existed and reload them into the credentials properties and use them without the need for another Authenticate call. I'm wondering what the equivalent technique is in the new API. I'm browsing through the source now, but I thought it might be quicker to ask in the forum.
Greg
Request form for an account on http://teamcity.codebetter.com
It is TeamCity.
Rackspace has a Jenkins server for CI for other openstack projects, that would be an option also
Currently the UpdateAccountHeaders
method resets all headers for the account, including all metadata. If the user does not explicitly include all of the X-Account-Meta-
metadata entries in the headers
argument, then the metadata will be erased by this call.
In order to document the behavior of the IObjectStorageProvider
interface, how should this method behave?
headers
argument with a dictionary containing only the metadata headers already present on the object.Multithreaded code should be able to use multiple instances of CloudFilesProvider
concurrently, as long as each instance is only used by one thread at a time. This behavior needs to be verified.
We've got methods to retrieve object metadata and headers, so we'll need some corresponding methods for updates.
I will be posting another discussion/question on the issue of metadata and headers.
Greg
WCF Attribute | Json.NET Attribute |
---|---|
DataContractAttribute |
JsonObjectAttribute |
DataMemberAttribute |
JsonPropertyAttribute |
IgnoreDataMemberAttribute |
JsonIgnoreAttribute |
The Dictionary<string, string>
instances returned by various methods in IObjectStorageProvider
should be case-insensitive, since the keys represent HTTP headers which are required to be treated as case-insensitive.
Currently there is no way to download just a portion of a file. This feature is supported by the API and could be useful in certain applications.
DeleteContainer
should only recursively delete the contained objects when explicitly requested. In other words, the deleteObjects
parameter default value should be false
.
Currently HttpResponseCodeValidator
only throws exceptions for a predefined set of HTTP error codes. An exception should still be thrown for HTTP status codes over 300 which are not explicitly included in the list of known error codes.
Folks, this is a question about the underlying Cloud Files API, but I hope it is relevant to this forum.
Often I need to perform many operations in a logical group, such as deleting a container requires deletion of each object before you can delete the empty container. This requires a very "chatty" set of potentially large numbers of continuous REST calls, which could take a long time.
A similar problem I found last week was loading a grid with a list of containers and I wanted to include in each row the X-Meta key 'Comment' value for each container, but the only it seems I can do this is to list the containers and then get the meta data for each container with a call for each container. I found this to be absurdly slow and impractical.
So I downloaded the Feb 2013 Developer Guide to see if there was some way of performing "bulk" or aggregated Cloud Files operations in fewer calls, but I can't see any such feature. Can someone confirm that the Cloud Files API does not support the concept of aggregating many operations to reduce API calls?
If it doesn't have such support, then it seems a like a curious oversight considering the product is supposed to contain astronomical numbers of containers and objects. How would anyone delete a container with thousands of objects in a reasonable time for example?
Cheers,
Greg K
P.S. How do I mark issues as 'question', 'bug', etc?
Folks, I'm often getting confused about the relationship between the metadata and headers for containers and objects. Does anyone clearly understand how they are intended to be used and updated?
Briefly, here are some of the things confusing me: metadata seems to be "free form" and you can add and delete as many items as you want (subject to the underlying rules of course). Some metadata item names are special and cause special behaviour. Container headers on the other hand have predefined values that can't be deleted and also have special names that cause special behaviour. The APIs are slightly inconsistent between them, you can delete metadata items but there seems to be no direct way of deleting headers. Also, metadata and headers behave differently for containers and objects.
So overall, I remain a bit confused about exactly how metadata and headers are intended to be used and modified. I'm writing a UI editor for metadata and headers, but it can't work perfectly unless I have an equally perfect understanding of how the data is intended to be manipulated. I'd like to hear from anyone who has an insight into this subject or can perhaps point me to the laws that govern metadata and headers.
Thanks, Greg
I was trying to remove versioning on a container by sending the header:
x-remove-versions-location: junk
However it seems to have no effect. Web searches turned up a similar discussion here: https://bugs.launchpad.net/swift/+bug/1107592. Is this a bug in the .NET SDK or the underlying API? Is there a workaround or can it be fixed?
Cheers, Greg
If IObjectStorageProvider.CopyObject
is called, and no destinationContentType
is specified, the content type of the source object should be preserved.
As compared to the Bulk Delete documentation, the SDK implementation currently differs in the following ways:
/
is omitted/
between the container name and object name gets URL encoded as %2f
The following methods ignore the filter parameters when specified by the user.
CloudServersProvider.ListFlavors
CloudServersProvider.ListFlavorsWithDetails
Due to the fact that Cloud Files interprets metadata values as UTF-8 strings instead of ISO-8859-1 strings, the SDK does not support creating metadata values with characters which are not 7-bit ASCII characters.
The SDK can work around this issue (providing support for Unicode characters in metadata values) within the HTTP specification by UTF-8 encoding the values and then reinterpreting the bytes as an ISO-8859-1 sequence.
To support proper F1 functionality, the project should provide documentation in MS Help Viewer format.
I'm keeping some notes on this subject below:
The manifest will need to have the name HelpContentSetup.msha
.
The Help Library Manager needs to be launched as an administrator, which is apparently non-trivial. SHFB outputs a helper executable HelpLibraryManagerLauncher.exe
which can be used to install the documentation in VS 2010 as follows:
HelpLibraryManagerLauncher.exe /product VS /version 100 /sourceMedia HelpContentSetup.msha
I have to reproduce the behaviour of Cyberduck when it uploads files in nested folders and it creates a pseudo-folder structure using "/" as the delimited character in object names, and it also creates zero length dummy folders with content-type "application/directory".
The CreateObject methods allow the creation of objects with "/" delimiters in the names, but I am unable to find a way of creating a dummy folder with content-type "application/directory" and zero length.
Is there are way of making dummy folders like Cyberduck does?
Greg K
I have a question about the intended behavior of the IHttpResponseCodeValidator.Validate
method in several scenarios. For reference, the signature of the method is the following:
bool IHttpResponseCodeValidator.Validate(Response response)
It's clear that if response
indicates a successful response, the method should simply return true
. The other two things an implementation can do is 1) return false
or 2) throw an exception, presumably ResponseException
.
Questions:
false
?ResponseException
?ArgumentNullException
(if response
is null
) and ResponseException
, what exceptions might an implementation of this method throw?Hello,
I have successfully integrated Rackspace Cloud Files using the openstack.net platform. Everything works perfectly on my development machine. However, when I attempted to run functions from my deployment server, I get the follow error:
Any help will be appreciated.
MESSAGE : Received an unexpected EOF or 0 bytes from the transport stream.
STACK TRACE :
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.TlsStream.CallProcessAuthentication(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result)
at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.ConnectStream.WriteHeaders(Boolean async)
Dears,
i am trying to use CopyObject Method to copy an object from one container to another container, but doing so it only transfers the header information and not the full file.
I even tried using the useInternalUrl = true, but it returns a null response header when the service endpoint is sent a GET request.
The openstack.net SDK is documented according to the information found in several API reference pages. To facilitate long-term maintenance of this SDK and its documentation I am planning to add a list of references to the commit hashes of each of the documentation repositories, which will allow us to monitor each of those repositories for changes and efficiently verify the correctness of our code whenever a change is made.
OpenStack API | Documentation URL | Documentation Repository (Git) |
---|---|---|
Identity | http://docs.openstack.org/api/openstack-identity-service/2.0/content/ | openstack/identity-api |
Block Storage | http://docs.openstack.org/api/openstack-block-storage/2.0/content/ | openstack/volume-api |
Object Storage | http://docs.openstack.org/api/openstack-object-storage/1.0/content/ | openstack/object-api |
Networks | http://docs.openstack.org/api/openstack-network/2.0/content/ | openstack/netconn-api |
Compute | http://docs.openstack.org/api/openstack-compute/2/content/ | openstack/compute-api |
Rackspace API | Documentation URL | Documentation Repository (Git) |
---|---|---|
Identity | http://docs.rackspace.com/auth/api/v2.0/auth-client-devguide/content/QuickStart-000.html | IX/auth-2.0 (GHE) |
Block Storage | http://docs.rackspace.com/cbs/api/v1.0/cbs-devguide/content/overview.html | IX/cbs-api (GHE) |
Object Storage | http://docs.rackspace.com/files/api/v1/cf-devguide/content/Overview-d1e70.html | IX/cloud-files (GHE) |
Networks | http://docs.rackspace.com/networks/api/v2/cn-devguide/content/ch_preface.html | IX/cloud-networks (GHE) |
Compute | http://docs.rackspace.com/servers/api/v2/cs-devguide/content/ch_preface.html | IX/cloud-servers (GHE) |
When either the public or private ServerAddress
is missing, and you try to access its cooresponding property and exception is thrown. This should return null instead.
Migrated from rackspace#17.
Hi,
It looks like setting content-type in the HTTP POST sets the file object's content-type, but is there a way to do that using the .net api calls? I tried putting it in the headers dictionary but got an exception: "The 'Content-Type' header must be modified using the appropriate property or method. Parameter name: name".
Thanks
Currently IBlockStorageProvider.CreateVolume
returns a bool
, leaving the caller without access to the ID of the newly created volume. The method should instead return a Volume
instance containing the Id
.
When running on Rackspace Cloud Sites (.NET 4.0) and trying to use openstack sdk .net (nuget package 1.1.3.1) to access Cloud Files I get the following error:
Server Error in '/' Application.
Inheritance security rules violated while overriding member: 'net.openstack.Providers.Rackspace.Exceptions.UnknownGeographyException.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.TypeLoadException: Inheritance security rules violated while overriding member: 'net.openstack.Providers.Rackspace.Exceptions.UnknownGeographyException.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.
Source Error:
[No relevant source lines]
Source File: RackSpaceCloudFileService.cs Line: 63
Stack Trace:
[TypeLoadException: Inheritance security rules violated while overriding member: 'net.openstack.Providers.Rackspace.Exceptions.UnknownGeographyException.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.]
net.openstack.Providers.Rackspace.CloudIdentityProviderFactory.Get(CloudIdentity identity) +0
net.openstack.Providers.Rackspace.CloudIdentityProvider.GetUserAccess(CloudIdentity identity, Boolean forceCacheRefresh) +28
net.openstack.Providers.Rackspace.ProviderBase`1.GetServiceEndpoint(CloudIdentity identity, String serviceName, String region) +162
net.openstack.Providers.Rackspace.ProviderBase`1.GetPublicServiceEndpoint(CloudIdentity identity, String serviceName, String region) +9
net.openstack.Providers.Rackspace.CloudFilesProvider.GetContainerCDNHeader(String container, String region, CloudIdentity identity) +102
our code
AFAIK Rackspace is running a modified medium trust environment as described at:
http://www.rackspace.com/knowledge_center/article/modified-medium-trust-on-cloud-sites
If I use their modified web.config file locally I can reproduce the same issue.
Currently, if DeleteContainer
is called on a non-empty container, and the deleteObjects
argument is false
, the implementation throws a ServiceConflictException
. This may be unintuitive since one of the ObjectStore
enumeration members is ContainerNotEmpty
. Which of the following is the intended behavior of DeleteContainer
when the container could not be deleted in this case?
ServiceConflictException
. This is the current behavior, so if this is correct it needs to be clarified in the documentation.ObjectStore.ContainerNotEmpty
. If this is the intended behavior, the implementation needs to be updated to follow it correctly.Email from user describing the issue:
Hi all,
I’ve been playing with the .NET SDK today and have run into an issue when using UK accounts (tried on 3 accounts now).
The response from the API doesn’t set the “RAX-AUTH:defaultRegion” on UK accounts. This causes GetServiceEndpoint (Line 136 ProviderBase.cs) to throw UserAuthorizationException("The user does not have access to the requested service or region.") if I do not manually pass the SDK a region.
On my US account, the API responds with
"name":"[REDACTED]",
"RAX-AUTH:defaultRegion":"DFW"
Yet the API responds with the following on my UK account
"name":"[REDACTED]",
"RAX-AUTH:defaultRegion":""
Below is code to reproduce the issue and attached is the full API response (minus token).
RackspaceCloudIdentity auth = new RackspaceCloudIdentity();
auth.Username = txtUsername.Text;
auth.Password = txtPassword.Text;
auth.CloudInstance = chkRegion.Checked ? CloudInstance.UK : CloudInstance.Default;
servers = new CloudServersProvider(auth);
servers.ListServers();
A workaround would be to set the region when calling (for example) CloudServersProvider.ListServers(), but should it not be able to figure that out when I set the CloudInstance to UK?
Thanks
Hello, me again! I have to add, change and remove metadata from containers. I haven't done this before, I didn't even need to do it my old apps. In my experiments I can Add metadata key/value pairs to the dictionary and call UpdateContainerMetadata and it works OK. I can change values and update them OK. However, I can't find a way of removing metadata items. If I remove items from the dictionary and update then they remain. In particular, if I update with an empty dictionary in the hope that it will clear all metadata items, it has no effect.
Am I using the wrong technique, or is it not possible to remove container metadata items with the current API?
Cheers, Greg
The AddContainerHeaders
and UpdateAccountHeaders
methods are unnecessary. All user-defined headers associated with these items must start with the metadata prefix, so the metadata methods are all that's necessary.
The PurgeObjectFromCDN
method overloads are ambiguous when the optional parameters are omitted at the call site. For consistency with other methods in the interface, this should be resolved by reducing the method to a single signature, where the emails
parameter in optional.
Migrated from rackspace#10.
Hi guys,
I just started using the openstack.net SDK for .Net and it is really great except for some key issues. when creating objects one has to be able to pass the client location of the file before it can be uploaded and that creates a huge concern because in visual studio the fileupload control does not return the full path of the client file location because of browser security reasons, so im wondering if anything can be done as regards to this, if there is a work around it would be great, because it would allow developers to design applications that use the familiar file upload control with ease.
Also i would really love to see a means of getting the value of the CDN link of a container returned when created, or a way to read the name of the container CDN link via a property. This is useful because a developer might need to build the url to access the file in code and would want to store it in a database for easy access.
Great job on the SDK though it really works and its quite easy to use.
Reply by @alanquillin:
Yes you are correct about the fileupload object, as this code is run on the server side, it will not have access to the clients local file. When you are uploading the file, you can can try 2 things:
- You can save the uploaded file locally to the server, then send it to CloudFIles using the CreateObjectFromFile method. This is not recommended as it is actually transfers the file twice.
- As you stream the file from the client, use the CreateObject method of the CloudFilesProvider. This method takes in a Stream object instead of a file location. This will send it to CloudFiles as you get it form the client without having to buffer it to the server's disc intermediately.
Hope this help.
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.