module 'zcrmsdk' has no attribute 'ZCRMRestClient' - zoho

I am unable to get the following working:
import zcrmsdk
config = {
"apiBaseUrl":"https://www.zohoapis.com",
"apiVersion":"v2",
"currentUserEmail":"sample#gmail.com",
"sandbox":"False",
"applicationLogFilePath":"./log",
"client_id":"1000.1xxxxxxxxxxxxxxxxxxxxxxxxxxxC",
"client_secret":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"redirect_uri":"http://localhost:800/some_path",
"accounts_url":"https://accounts.zoho.com",
"token_persistence_path":"",
"access_type":"online"
}
zcrmsdk.ZCRMRestClient.initialize(config)
oauth_client = zcrmsdk.ZohoOAuth.get_client_instance()
grant_token = "1000.xxxxxxxxxxxxx.....xxxxxxxx...x.x.x"
oauth_tokens = oauth_client.generate_access_token(grant_token)
print(oauth_tokens)
I get the AttributeError: module 'zcrmsdk' has no attribute 'ZCRMRestClient'
I know I am missing something. What am I missing? Can someone please help?

Had the same issue. I think it has to do with the version you are using.Version zcrmsdk==2.0.12 has this attribute available.

Related

Trying to get property 'menu_display_categories' of non-object

I'm having issues with this... I'm trying to install "downGrade - Single Vendor Digital Products Marketplace
"
https://codecanyon.net/item/downgrade-single-vendor-digital-products-marketplace/28803672?gclid=Cj0KCQjw2MWVBhCQARIsAIjbwoOi08ajt47xsPKUsGZ7V7mr7KD5W_CwaQS-BfF1tbP1OE0-LpNdR6caAmCbEALw_wcB
I'm getting this error code and I'd like to receive your help, thank you.
$admin = Members::adminData();
View::share('admin', $admin);
$allsettings = Settings::allSettings();
View::share('allsettings', $allsettings);
$allcountry = Settings::allCountry();
View::share('allcountry', $allcountry);
$country['country'] = Settings::allCountry();
View::share('country', $country);
$demo_mode = 'off'; // on
View::share('demo_mode', $demo_mode);
$main_menu['category'] = Category::mainmenuCategoryData($allsettings->menu_display_categories,$allsettings->menu_categories_order);
View::share('main_menu', $main_menu);
$footer_menu['category'] = Category::mainmenuCategoryData($allsettings->footer_menu_display_categories,$allsettings->footer_menu_categories_order);
View::share('footer_menu', $footer_menu);
$footerpages['pages'] = Pages::footermenuData();
View::share('footerpages', $footerpages);
$languages['view'] = Languages::allLanguage();
View::share('languages', $languages);
if(!empty(Cookie::get('translate')))
{
The reason why you getting the error is that the $allsetting is null.
$main_menu['category'] = Category::mainmenuCategoryData($allsettings->menu_display_categories,$allsettings->menu_categories_order);
The $allsettings gets the value from the setting table from the database where you can easily see the value menu_display_categories is nulled.
//Nulled here ---> $allsettings->menu_display_categories
Solution: Enter the values in all columns inside the setting table.

Using resource attributes as variable in Terraform templates

I'm trying to use the attributes of an EC2 instance as a variable, but it keeps failing or otherwise not working. As you can see below, I want to insert the private IP of the instance into a config file that will get copied to the instance. The remote-exec script will then move the file into place (/etc/vault.d/server-config.json)
instances.tf
resource "template_file" "tpl-vault-server-config" {
template = "${file("${path.module}/templates/files/vault-server-config.json.tpl")}"
vars {
aws_private_ip = "${aws_instance.ec2-consul-server.private_ip}"
}
}
provisioner "file" {
source = "${template_file.tpl-vault-server-config.rendered}"
destination = "/tmp/vault-server-config.json"
}
vault-server-config.json.tpl
backend "consul" {
address = "127.0.0.1:8500"
path = "vault"
tls_enable = 1
tls_ca_file = "/etc/consul.d/ssl/ca.cert"
tls_cert_file = "/etc/consul.d/ssl/consul.cert"
tls_key_file = "/etc/consul.d/ssl/consul.key"
}
listener "tcp" {
address = "${aws_private_ip}:8200"
tls_cert_file = "/etc/consul.d/ssl/consul.cert"
tls_key_file = "/etc/consul.d/ssl/consul.key"
}
The error on terraform plan is:
* aws_instance.ec2-consul-server: missing dependency: template_file.tpl-vault-server-config
Questions:
Am I taking the wrong approach?
Am I missing something basic?
How do you get an instance's attributes into a file?
Thanks in advance.
I realized that I was defining the template_file resource within the current resource and this was part of the problem. When I fixed that, things worked much easier.

error setting linkConfig.connectionString on sqoop 1.99.4

I followed https://sqoop.apache.org/docs/1.99.4/RESTAPI.html for trying out sqoop2. But Iam getting error "Exception in thread "main" org.apache.sqoop.common.SqoopException: MODEL_011:Input do not exist - Input name: linkConfig.connectionString" on the line linkConfig.getStringInput("linkConfig.connectionString").setValue("jdbc:mysql://localhost/my");
i tested sqoop2, mysql, database etc from terminal and working fine. please help. thanks in advance.
here is the code i am trying
import org.apache.sqoop.client.SqoopClient;
import org.apache.sqoop.model.MLink;
import org.apache.sqoop.model.MLinkConfig;
import org.apache.sqoop.validation.Status;
public class Sqoop2 {
public static void main(String[] args) {
//Initialization SqoopClient
String url = "http://<myip>:12000/sqoop/";
SqoopClient client = new SqoopClient(url);
// create a placeholder for link
long connectorId = 1;
MLink link = client.createLink(connectorId);
link.setName("Vampire");
link.setCreationUser("Buffy");
MLinkConfig linkConfig = link.getConnectorLinkConfig();
// fill in the link config values
linkConfig.getStringInput("linkConfig.connectionString").setValue("jdbc:mysql://<myip>/<dbname>");
linkConfig.getStringInput("linkConfig.jdbcDriver").setValue("com.mysql.jdbc.Driver");
linkConfig.getStringInput("linkConfig.username").setValue("root");
linkConfig.getStringInput("linkConfig.password").setValue("root");
// save the link object that was filled
Status status = client.saveLink(link);
if(status.canProceed()) {
System.out.println("Created Link with Link Id : " + link.getPersistenceId());
} else {
System.out.println("Something went wrong creating the link");
}
}
}
I faced the same issue. As per the documentation generic-jdbc connector id =1 and hdfs-connector id =2. But after we upgraded to 5.3.2 the id's were swapped.
Don't hard code the connector Id's(as said in the documentation). Use client.getConnectors(); or show connector --all method to look for existing connectors and get the connector Id you need. There is currently an issue logged for this https://issues.apache.org/jira/browse/SQOOP-1965.
Looks like connector 1 is already exists. Can you try with another id ?

Breeze filtering not working

I am using breeze and the filter does not work.
var EntityQuery = breeze.EntityQuery;
var manager = configureBreezeManager("xxx");
function configureBreezeManager(param) {
breeze.NamingConvention.camelCase.setAsDefault();
var mgr = new breeze.EntityManager(param);
model.configureMetadataStore(mgr.metadataStore);
return mgr;
}
And my query query
var query = EntityQuery.from('GetStudents').where("Id", "==", "xxx");
return manager.executeQuery(query)
The filter is ignore and all results are returned. my get student returns an IQueryable of all students.
public IQueryable<Students> GetStudents(){
return context.Students;
}
Is there something up there I am doing wrong or should I look elsewhere?
EDIT
I realize that my controller is missing the property [BreezeController]. But when I include that, me metadata path is not found giving me an error (error 500 below) when trying to load it. The matadata loads fine without this property on the controller, but filtering does not work. Is this related?
"Could not load file or assembly 'System.Web.Http.OData, ... or one of its dependencies. The system cannot find the file specified."
Your issue might be that you have specified a 'camelCase' namingConvention, but your query is for 'Id' instead of 'id'. i.e. try:
var query = EntityQuery.from('GetStudents').where("id", "==", "xxx");
return manager.executeQuery(query)
I was missing the [BreezeController] and after adding it, I received the error Could not load file or assembly System.Web.Http.OData, Version=4.0.0.0 and was able to solve it by runing Install-Package Microsoft.AspNet.WebApi.OData in the package manager

How getValue except from attribut ID in EXT.Net Razor Engine?

code in listeners bellow get value from ID #{CheckAll},
I want get value from other attribute.
#Html.X().ResourceManager()
#Html.X().Checkbox()
.Name("CheckAll")
.BoxLabel("CheckAll")
.ID("CheckAll")
.Checked(false)
.Listeners(l => l.Change.Handler = #"var checkAll = #{CheckAll}.getValue();
if(checkAll){
#{CheckAll2}.setValue(true);
}");
I think your sample should work if you change #{CheckAll} to App.CheckAll and #{CheckAll2} to App.CheckAll2.
Hope this helps.

Resources