Is there an Objective-C client for Cassandra? - objective-c

I want to access a Cassandra instance in an Iphone application and i need an objectiveC client
for that. I couldnt find one, Thrift is supposed to support ObjectiveC but I couldnt figure out how to do that. If anyone has any knowledge on the subject it is very much appriciated.

Apache Thrift has a generator for ObjC. (Complete list).
If you will distribute the application I would considered the alternative to create a server with simple interface (eg. http) that in turns access the cassandra database.
But if you are the only user it could work with direct database access.

If you're not sure about how to get Thrift to generate the bindings then go with what Schildmeijer posted. Use a simple web server running php + phpcassa or any language of your choice that comes with a high level client library -- list here: High level clients.
You can use some open source libraries to expose resources from Cassandra as JSON or XML then use NSURLRequests to do the work. If you go with XML then Google's GDataXML is an excellent choice of parser, if you go with JSON then json-library on Google Code is another great choice.
Have fun!

Related

how to testing of services having Apache Thrift based RPC protocol using karate [duplicate]

We have a requirement where we need to send .avro file as an input request to our API's. Really stuck at this point. If any detail example provided would be more appreciated.
Just use Java interop: https://github.com/intuit/karate#calling-java
You need to write a helper (start with a static method) to convert JSON to Avro and vice versa. I know teams using this for gRPC. Read this thread for tips: https://github.com/intuit/karate/issues/412
Also there is even a "karate-grpc" project: https://github.com/pecker-io/karate-grpc
Also see:
https://twitter.com/KarateDSL/status/1128170638223364097
https://twitter.com/KarateDSL/status/1417023536082812935

Marshmallow and Flask-RESTPlus, how should they be used along?

I'm using Flask-Restplus to marshal responses in a Flask server. I also began using this package to parse HTTP requests from the client, when I stumbled about this huge warning on their site:
Warning
The whole request parser part of Flask-RESTPlus is slated for removal
and will be replaced by documentation on how to integrate with other
packages that do the input/output stuff better (such as marshmallow).
I then switched to Marshmallow to validate/parse the HTTP client requests. Thus, the workflow in my server is:
Client request (HTTP GET/POST) ...
--> process request with Marshmallow and validate/format data
--> do stuff with DB (read, update, create)
--> Format output response with Flask RESTPLUS
... Client response
So far this works well. However, is this the correct way to use Flask RESTPLUS and Marshmallow along? On the marshmallow website, there is no clear direction towards a specific use of this package. The documentation just says:
Marshmallow is an ORM/ODM/framework-agnostic library for converting
complex datatypes, such as objects, to and from native Python
datatypes.
I have seen examples in the web where people use Marshmallow to format the output response, and Flask to validate expected data (with #api.expect). Which approach is better?
Also, I wonder if this even makes sense to use Flask RESTPLUS at all? It seems the only interest of this library is to have the Swagger UI doc automatically generated. Other than that, Marshmallow can do everything that Flask RESTPLUS does. So maybe I missed out something, can anyone help or comment?
Thanks
Take further notice of the warning displayed on the website:
Don’t worry, if you have code using that now and wish to continue doing so, it’s not going to go away any time too soon.
The developers will post documentation how to integrate best Marshmellow in the future.
So far this works well. However, is this the correct way to use Flask RESTPLUS and Marshmallow along? On the marshmallow website, there is no clear direction towards a specific use of this package
Flask is a microframework: what this means for you is that much of the implementation of your application is up to the programmer because it lacks most of the functionality which is common to expect in a full-fledged web application framework (eg. Django, Pyramid et al.) and there's not "one way and only one way" of doing things in it. Implementation details like data validation are up to you to provide via plugins, libraries or even implementing them yourself (not recommended).
I wonder if this even makes sense to use Flask RESTPLUS at all?
From what I've seen in the Quick start page of Flask-RESTPlus, it provides useful models that facilitates exposing REST verbs for resources, endpoints, arg parsing and data formatting. But again, this question depends mostly on you and your application requirements.

SAP B1 - using stanard dll's in a SOAP web service

Currently, I am working with SAP Business One SDK. I took some project from another team. This project is a SOAP web service. It has been written in ASPX technology, anyway another team used standard DI API library. This is the main problem with this solution because it causes a lot of problems with memory leaks.
In source code after every operation when DI API is called I try to use Garbage Collector, but unfortunately, it is not enough.
The web service is hosted on IIS and I had to set an option that for some time restart it. I know it is not the best solution, but it works. Obviously, that way generates many problems.
I have a question about it. Does any reasonable solution exist? Or I will have to rewrite source code using DI Server?
I have read a lot about this, I found some articles on the Internet. Please do not put any links in comments, because I am quite sure that I have read them.
Every time you use a DI API object you have to release it. Otherwise, it will stay in memory and it will cause the memory leak you mentioned.
The correct way to release them is to use ReleaseComObject. Remember that if the object is null you will get an exception so check it first.
if (oDocuments != null)
System.Runtime.InteropServices.Marshal.ReleaseComObject(oDocuments);

Integrating System Center Operation Manager [SCOM] with external monitoring tool [Application]

WHAT AM I TRYING TO ACHIEVE
Synopsis:
Trying to create an API or connector for an inhouse monitoring tool that integrates with SCOM [System Center/Microsoft System Operations Manager 2012].
Our tool has a restful page with all the necessary endpoints and simply would like SCOM to read the status of those endpoints.
Thus far according to SCOM documentation and my understanding, I need to build a management pack. And this consists of Authoring tools with visual studio etc.
Whilst I am still going through the documentation on this, whose tackled something like this before. Some guidance on how to approach this would be appreciated.
##### UPDATE [04/01/16] ########
Thinking.... * Plan to create a MP(s) for Discovery, Monitoring and Dashboard.*
New Question...
Created a script using posh that exposes the endpoints needed by SCOM.
+ These need to be converted to a class object (converting posh to xml). - not done yet!
+ Thinking ahead I am not sure what Base Class to use for this discovery script?
A very simple way to do this would be with Web Application Availability Monitoring, which works with any HTTP endpoint. As well as checking availability, this monitor can check the content of the response and raise an alert accordingly.
To get started, use the SCOM console and navigate to Authoring > Management Pack Templates > Create > Web Application Availability Monitoring
This blog is a really good walkthrough of doing that:
http://www.opsmanfan.com/index.php/6-use-scom-2012-to-monitor-a-webapi-without-using-scripts
Some limitations with this approach vs. a custom management pack:
you won't get any control over the alert content (name, desciption etc)
it won't scale well to many monitors (in terms of administrative burden)
you can't represent the health using a complex object model (no classes / discoveries)
If you want to test a large number of URLs with this method, then a community Management Pack called URLGenie might also help:
http://blogs.msdn.com/b/tysonpaul/archive/2015/05/04/urlgenie-management-pack-for-scom-an-easy-solution-for-bulk-website-monitoring.aspx
You are right that custom MP is the right way to do an integration of the custom/third-party monitoring system with SCOM. You have to think about three important things when you are planning your work on such MP:
How you are going to get information from external system
How you are going to persist and use it in SCOM
How you are going to visualize it in SCOM
Let's walk through these three items:
From your intro it looks obvious - your system exposes RESTful API. SCOM (even 2012 or 2016) doesn't have native datasources to parse JSON so you'll need to create custom datasources using Powershell or C# (depends on your experience) . In this case, it might be reasonable to use any standard library to make this job easier.
SCOM has its special object model. You have classes to represent objects, monitors to detect failures/state changes and rules to collect performance metrics and alerts/events. So you'll need to implement Discovery datasources to get data about objects, monitored by your custom monitoring system (such as servers, databases, disks, apps, etc.) and define a class hierarchy to persist these objects in SCOM.
Then you'll need to create datasources for monitors and rules and here you must think before act - what failures, alerts and metrics you want to expose to SCOM. When you have clear understanding of this area - you are good to implement that (again - using PS or C#).
SCOM will give you some OOB visualization after you dome (1) and (2), so in the minimal scenario you'll need to define just a couple of views to show in SCOM console data collected by your MP. In ultimate case - if you want to have some fancy visualization - you'll have to create custom Dashboard. A good option here - use dashboards from SQL Server MP (it was released recently, it's free and it is really cool).
In fact, SCOM is not a monitoring system, but a framework, which has runtime platform, development language, and libraries, so building your own MP is closer to programming than IT administration :)
You also can try to use Silect MP authoring tool, but I'm not sure if it will help you to build custom datasources better than VS.
Good luck!
P.S. feel free to ping me via LinkedIn for more details about MP development.

Problems creating OData proxy class - connecting to Azure using Objective C

I hope anyone can help me.
My plan was to connect to Microsoft Azure with my iPhone application. I don't have any experiences using http requests with Objective C yet. So I searched all day long on how to use Azure with Objective C...
I found out that one should use OData to create a proxy class which should help to connect to Azure (http://www.interoperabilitybridges.com/projects/odata-client-for-objective-c-%28ios-macos%29).
So I tried configuring like it says in OData's user guide. But I don't understand how to create a proxy class: I tried to compile the odatagen.xcodeproj but I got a Range or index out of bounds error.
However I typed this in Terminal:
./odatagen /uri=https://{serviceNamespace}.serverbus.windows.net /out= users/xyz/Documents[...] /auth=acs /u=myusername /p=mypassword /at=https://{serviceNamespace}.serverbus.windows.net /sn={serviceNamespace} /ups=no
(Of course replacing {serviceNamespace} with the name of my service namespace etc.)
Did I get all those parameters right? I get an mystical error saying fileRange Error While moving xslt file: (null)... :-(
Or am I totally wrong and connecting my app with Azure works with different tools?
I'm sure you could get it working with what you're doing, but Microsoft have done a lot of the hard work for you. Take a look at the Windows Azure Toolkit for iOS on git hub, it's probably the best place to start.