How to upload files to XTRF so a local file can be referenced in call to createSimpleQuote - xtrf

Trying to understand options for attatching input files can to a quote/project when using the Web Service API for Partners 1.0.
We have figured out how to use the login and the createSimpleQuote SOAP methods to create a Quote as a customer.
The thing step that we are struggling with now is how to upload the input files that are to be referenced in the files section of the payload to createSimpleQuote.
<par:files>
<par:name>?</par:name>
<par:category>?</par:category>
<par:url>?</par:url>
</par:files>
Ideally we like the url element to reference local files (using file:///tmp/sample.pdf) as it is done in the java usage example).
What options do we have for uploading files?
How do we get the local path value of an uploaded file that can be used in the createSimpleQuote SOAP call?
Please advice?

It is not possible to upload files from your local disk to XTRF via Web Service API.
In order to reference a file using file:// protocol, the file must be visible to XTRF. There are several options to do this:
the file should be uploaded before sending request to the XTRF Web Service API
request to the XTRF Web Service API should be sent from the same machine where XTRF is running
remote disk where the file is stored should be mounted (e.g. using CIFS, NFS or another network filesystem protocol) on the machine where XTRF is running
Note that it is also possible to refer to a file using other protocols, e.g. http:// or ftp://.

Related

Azure Service Fabric REST API - how to copy application package to image store?

I am looking for Service Fabric REST API method for copying an application package to the image store of a service fabric cluster. That is, method similar to Power Shell cmdlet Copy-ServiceFabricApplicationPackage and Service Fabric Client .NET API method FabricClient.ApplicationManagementClient.CopyApplicationPackage.
I can't find such a method from Service Fabric Client REST API Reference.
How similar operation should be done using Service Fabric REST API methods?
I managed to copy the manifest files using ImageStore REST API method Upload File. In this case only the manifest files are uploaded as they define Azure Container Registry location where container packages are stored. After manifest files were loaded to ImageStore, I succeeded to Provision Application Type to Service Fabric Cluster.
Details that caused me some head-ache:
Upload File: manifest files were uploaded to image store into a folder with subfolders. An empty file '_.dir' needed to be uploaded into each folder; this is a mark file used by image store service internally to indicate the availability of the linked folder. See API reference and GitHub discussion 'Provisioning application type throws exception'.
Image Store contents can be checked with REST API method Get Image Store Content. Anyhow, the uploaded files are not visible via this method until application type is provisioned.
If you Provision Application Type using 'ImageStorePath' option, the value given to body parameter ApplicationTypeBuildPath is relative to 'fabric:ImageStore'. I spent some quality time using 'fabric:ImageStore/MyAppType' until I realized to fix this to 'MyAppType'.
AFAIK both CopyApplicationPackage and Copy-ServiceFabricApplicationPackage use ImageStore API under the hood, so I think ImageStore REST API is what you are looking for.

Read a Bitbucket resource using curl with Access Keys

I configured my Bitbucket repo to be read-only accessible via REST API publicly. There are some JSON configuration files that I need to read the content using GET HTTP method.
https://<bitbucket-repo-url>/config.json?raw
I want to switch to a secure method using Access Keys.
I want to try to test this using curl, but I don't know the arguments on including the access keys. Can anyone help?
Access keys are for SSH only. They will not work with any HTTP-based utilities (like curl) or endpoints (like the one you list in your example).
Is this Bitbucket Server (the on-premise version)? If so, https://confluence.atlassian.com/bitbucketserver/permanently-authenticating-with-git-repositories-776639846.html?_ga=2.188793826.854670382.1505151098-758028192.1431549295 may be helpful for you.

How to make IBM Bluemix Object Storage file publicly accessible?

On Bluemix, I created a Java application using Liberty for Java and the Object Storage Service. I then bound the Java Application and Object Storage Device. I uploaded the images into the container which I created in the Object Storage service. Now I want to access the uploaded images publicly, such as opening the images in a browser directly. I created the URL like the IBM Bluemix documentation said. After I access the URL in browser it shows the following error:
401 Unauthorized
Unauthorized
This server could not verify that you are authorized to access the document you requested.
My sample URL
Is it possible to make the URL public?
You can create a temporary public URL using the swift command line.
First you need to set a key and they create the temporary url. For example:
swift post -m "Temp-URL-Key:yourkey"
swift tempurl GET 3000 /v1/AUTH_90e12a182adf4a32bbd5e34645380244/offermsgs-cateimgs/books.jpg yourkey
The output of the command above will be your temporary public URL and in the example below it will be valid for 3000 seconds.
You can modify Object Storage ACL as well to make all files read only as suggested in the following post:
Public URLs For Objects In Bluemix Object Storage Service

Do I need account-based permissions to initialize an mssoap client from a wsdl file?

I'm getting the this error when I try to use an ASP.NET WebService through an MSSOAP Client:
"WSDL Reader: Loading of the WSDL file failed HRESULT=0X80040154 Class not registered - Client: An
unanticipated error occured during the processing of this request.HRESULT=0x1812040:Class not registered."
At first I thought the SOAP library was not properly registered. But when I debugged the code I realized the error was being raised at the time of reading the web service definition (The Soap client does get created).
SOAPClient.mssoapinit "wsdl_URL"
Now, the issue only occurs when I execute the code as certain account (as for the rest of the accounts the code works pretty well). The original client is a Classic ASP page but I've reproduced the problem using a vbs script.
I run the script under several accounts, but just one presents the wsdl-reading failure.
I've granted reading permissions to the directory that contains the
asmx file to the failing account.
I've changed the physical path of the virtual directory where the
webservice is hosted to a general non-particular-profile location
like C:.
Ironically the application pool identity of the web application is
the account that presents the failure.
All the accounts can read the wsdl file through a browser just typing
the url (but still one of them can't from client code)
Do I need to grant additional permissions for the account in order to read the web service definition and initialize the soap client?

Programmatically download RDP file of Azure Resource Manager VM

I am able to create VM from a custom image using Azure resource management sdk for .net. Now, I want to download the RDP file for virtual machine programmatically. I have searched and able to find Rest API for azure 'Classic' deployments which contains an api call to download RDP file but i can't find the same in Rest API for 'ARM' deployment. Also, I can't find any such Method in .net sdk for azure.
Does there any way exist to achieve that? Please guide..
I don't know of a way to get the RDP file, but you can get all the information you need from the deployment itself. On the deployment, you can set outputs for the values you need like the publicIp dns. See this:
https://github.com/bmoore-msft/AzureRM-Samples/blob/master/VMCSEInstallFilePS/azuredeploy.json#L213-215
If your environment is more complex (load balancers, network security groups) you need to account for port numbers, etc.