Giter Club home page Giter Club logo

openstack.net's People

Contributors

alanquillin avatar annegentle avatar azure-pipelines[bot] avatar carolynvs avatar donschenck avatar dwalleck avatar edleafe avatar eltone avatar gitter-badger avatar gonnagle avatar jasonmitschke avatar jhaygood86 avatar jonwalton avatar maxlinc avatar sharwell avatar smoothdeveloper avatar surgicalcoder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openstack.net's Issues

After Image Move content type changed to application/json

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.

NOTICE: This repo is moving.

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'.

Unsigned Assembly

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?

CloudFilesProvider.UpdateContainerMetadata does not treat metadata keys equally

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

ListObjects container name with spaces

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

How to reuse authenticate token

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

IObjectStorageProvider.UpdateAccountHeaders handling of account metadata

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?

  1. Behave as-is, and include clear documentation for the call that the user must include any desired metadata with the set of headers or it will be removed.
  2. Behave instead as a "set non-metadata headers", implemented by merging the headers argument with a dictionary containing only the metadata headers already present on the object.

Complete methods for object metadata

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

Multiple Cloud Files API operations

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?

Metadata and Headers

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

x-remove-versions-location

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

Object storage provider does not support Unicode characters in metadata values

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.

Provide documentation in MS Help Viewer format

To support proper F1 functionality, the project should provide documentation in MS Help Viewer format.

I'm keeping some notes on this subject below:

  • Special considerations to support Help Viewer 1.0 (Visual Studio 2010)
    • 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
      
  • Answered questions
    • (Answer at related StackOverflow question) Currently a container node is created for the namespaces (called "API Reference"), but no container is created for the project as a whole. As-is, when the help is integrated it is displayed under the path "Help Viewer Home → API Reference". We want it to instead be "Help Viewer Home → OpenStack.NET → API Reference".

Creating pseudo-folders

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

Clarification of IHttpResponseCodeValidator.Validate behavior

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:

  1. In what specific cases should this method should return false?
  2. In what specific cases should this method throw a ResponseException?
  3. Aside from ArgumentNullException (if response is null) and ResponseException, what exceptions might an implementation of this method throw?

Received an unexpected EOF or 0 bytes from the transport stream.

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)

Locate repositories for the reference source

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)

Add support for setting Content-Type with CreateObjectFromFile()

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

Cannot run under medium trust on Rackspace Cloud Sites

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.

Clarification of IObjectStorageProvider.DeleteContainer with non-empty container

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?

  1. Throw a ServiceConflictException. This is the current behavior, so if this is correct it needs to be clarified in the documentation.
  2. Return ObjectStore.ContainerNotEmpty. If this is the intended behavior, the implementation needs to be updated to follow it correctly.

Exception thrown when no Default Region is set in London.

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

Removing container metadata items

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

Observations and usability

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:

  1. 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.
  2. 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.